'EPTEMBER1981
THE 6502/6809 JOURNAL
■ ^>Xl--.itn_Vi!j;..:r^Vi'T^jfc:>TVi;
^ble Apple Bonus featuring Graphics
Jumps and the 6502
creen Print Utiiity for Atari 400/8
6809 Addressing IVIode^ ^
ci|>r>i<z i£
Turn your Apple into the world's
most versatile personal computer.
The SoftCard™ Solution. SoftCard
turns yo^r Apple into two computers,
A Z-80 and a 6502. By adding a Z-80
microprocessor and CP/IVl to your
Apple. SoftCard turns your Apple into
a CP/lvl based machine. That means
you can access the single largest body
of microcomputer software in exist-
ence. Two computers in one. And, the
advantages of both.
Plug and go. The SoftCard system
starts with a Z-80 based circuit card.
Just plug it into any slot (except 0) of
your Apple. No modifications required,
SoftCard supports most of your Apple
peripherals, and, in 6502-mode, your
Apple IS still your Apple,
CP/M for your Apple. You get CP/M
on disk with the SoftCard package. It's
a powerful and 5imple-to-use operating
system. It supports more software
than any other microcomputer operat-
ing system. And that's the key to the
versatility of the SottCard/Apple.
BASIC included. A powerful tool,
BASlC-80 IS included in the SoftCard
package. Running under CP/M, ANSI
Standard BASIC-80 is the most
powerful microcomputer BASIC
available. It includes extensive disk I/O
statements, error trapping, integer
variables, 16-digit precision, exten-
sive EDIT commands and string func-
tions, high and low-res Apple graphics,
PRINT USING, CHAIN and COM-
IVION, plus many additional com-
mands. And, it's a BASIC you can
compile with Microsoft's BASIC
Compiler
More languages. With SoftCard and
CP/M, you can add Microsoft's ANSI
Standard COBOL, and FORTRAN, or
Basic Compiler and Assembly Lan-
guage Development System. All, more
powerful tools for your Apple.
Seeing is believing. See the SoftCard
in operation at your Microsoft or Apple
dealer. We think you'll agree that the
SoftCard turns your Apple into the
world's most versatile personal
computer.
Complete information? It's at your
dealer's now. Or, we'll send it to you
and include a dealer list. Write us. Call
us. Or, circle the reader service card
number below.
SoftCard IS a trademark of Microsoft. Apple II and
AppJe II Plus are registered trademark? of Apple
Computer. Z-30 is a registered trademark of Zilog,
Inc, CP/M IE a registered trademark of Digital
Research. Inc
CONSUMERS PRODUCTS
Microsoft Consumer Producis, 400 108th Ave. N B..
Bellevue, WA 98004 (206)454-1315
p
HAVE WE GOT
YOU IN m fttZ
Attend tlie biggest public computer shows in the country.
Each show has 100.000 square feet of display space fea-
luring over 50 Ivlillion Dollars worth of software and hard-
ware for business, industry, government, education, home
and personal use.
You'll see computers costing $150 to $250,000 including
mini and micro computers, software, graphics, data and word
processing equipment, telecommunications, office machines,
electronic typewriters, peripheral equipment, supplies and com-
puter services.
All the major names are there including; IBM, Wang, DEC,
Xerox, Burroughs, Data General, Qantel, Nixdorf, NEC, Radio
Shack, Heathkit, Apple, RCA, Vector Graphic, and Commo-
dore Pet, Plus, computerized video games, robots, com-
puter art, electronic gadgetry, and computer music to
entertain, enthrall and educate kids, spouses and peo-
ple who don't know a program from a memory disk.
Don't miss the Coming Of The New Computers-
Show Up For The Show that mixes business with
pleasure. Admission is $5 for adults and $2 for chil-
dren under 12 when accompanied by an adult.
TSJE-
Ticket Information
Send $5 per person with Ihf? name ot Ihe show
you will allend (o National Computer Shows.
824 Boylslon Street, Cheslnut Hill, Mass. 02167.
Tel 617 739 2000 Tickels can also be purchased
al Ihe show.
HiD-WE5T
CHICAGO
McCofmick Place
SCHOESSLING HALL
23rd 6 THE LftKE
THUR5-5UN
SEPT 10-13, 1981
1 1 AM TO 7PM WEEKDAYS
11 AM TO 6PM WEEKENDS
B=i=iJ-r! * £-=-;== = 5=_
WASHINGTON, DC
DC Armory /Starplex
2001 E CAPITALST.se
(ECAP ST EXIT OFF I 295
-KENILWORTH FRWY)
ACROSS FROM RFK
STADIUM
THURS-SUN
SEPT 24-27. 1981
1 1 AM TO 7PM WEEKDAYS
11AM TO 6PM WEEKENDS
L=» I ■ FsrSii I
BOSTON
Hynes Auditorium
PRUDENTIAL CENTER
THURS-SUN
OCT 15-18. 1 981
1 1 AM TO 7PM WEEKDAYS
11AMT06PM\WEKENDS
:aiR^Si±£-S^
ATLANTA
Atlanta Civic Center
395 PIEDMONT AVE NE AT
RALPH McGILL BLVD
THURS-SUN
0CT29+I0V1, 1981
1 1 AM TO 7PM WEEKDAYS
11 AUTO 6PM WEEKENDS
f~5^s5E5 : : -
LOS ANGELES
LA Convention Center
1201 SOUTH FIGUEROA
THURS-SUN
MAY 6-9, 1 982
11AM TO 7PM WEEKDAYS
1 1AM TO 6PM WEEKENDS
No. 40 -September 1981
MICRO - The 6502/6609 Journal
Losing Control?
ape
9
With Products From
Sirius Software
#
Gorgon: The earth has entered a time
warp , . . and the battle has just begun.
Orbitron: Action in orbit and attacks
from all sides.
Gamma Goblins: Avoid the hyperder-
mics while transporting blood to He-
mophilia.
Both Barrels: A two-game pack includ-
ing "Duck Hunt" and "High Noon."
Star Cruiser: Save yourself from the
swooping aliens.
Pulsar II: Pulsar and Wormwall in a
unique combination.
Phantoms Five: Real-lime 3-D fighter-
bomber challenge,
E-Z Draw: An easy, powerful, and ver-
satile Apple graphics editor, includes
the Higher Text generator by Ron and
Darrel A Id rich.
Cyber Strike: Challenging galactic
excitement for the real arcade gamer.
Autobahn: Hair raising excitement at
200 kilometers per hour.
Epoch: Explosive fast action with new
3-D effects. Complete with high speed
docking and a time warp that is sure to
give you vertigo.
Pascal Graphics Editor: Easy anima-
tion and powerful graphics editing has
finally arrived.
Sneakers: Unending variety and fun
as you meet the Sneakers, Cyclops.
Saucers, Fangs, H-Wings, t^leteors,
Scrambles, and Scrubs.
Space Eggs: Hatch some fun with the
spiders, lips, wolves, and Fuzzballs.
Applet] and Apple II -i- are regisleredErademarks of Apple
Computer, Inc. All games mentioned in this advertisement
arecopynghtedprDdfCfsof SiriusSoltware, Inc. All pighls
reserved.
Contact your local computer dealer for more information. Dealer inquiries inviteid.-
Sirius Software, Inc.f
»j
2011 ArdenWaY#2 Sacramento, CA 95825 (916)920-1939
MICRO - The 6502/6809 Journal
No, 40 -September 1981
STAFF
Ed I lot /Publisher
ROBERT M. TRIPP
Associate Pubiislier
RICHARD RETTIG
Associate Editors
MARY ANN CURTIS
FORD CAVALLARI
Special Projects Editor
MARJORIE MORSE
Production Coordinator
PAULA M. KRAMER
Typesetting
EMMALYN H.
BENTLEY
Advertising Manager
OATH I BLAND
Circulation Manager
CAROL A. STARK
Dealer Orders
LINDA HENSDILL
MICRO Specialists
APPLE: FORD CAVALLARI
PET; LOREN WRIGHT
OSI; PAUL GEFFEN
Comptroller
DONNA M. TRIPP
Bookkeeper
KAY COLLINS
Sales Representative
KEVIN B. RUSHALKO
603/547-2970
DEPARTMENTS
5 Edilorial
33 PET Vet
45 New Publications
93 Microbes
97 Hardvi/are Catalog
101 Softvifare Catalog
106 6502 Bibliography
111 Advertisers' tndex
112 Next Month in MICRO
/MCftO
THE 6502/6809 JOURNAL
ARTICLES
Q Jumps and the 6502 Mark Bernstein
^ Methods of jumping and branching are discussed
H c The Disk Switch Nelson E. Ingersoll
' '-' Add life to diskettes and disk drives, and save energy
on It's Time to Stop Dreaming, Part 4 Robert M. Tripp
^^ Addressing modes of the 6502 and 6809 are compared, new ones discussed
07 Journal It: Screen Print Utiiity for Atari johnEHioit
^ ' This ulility will capture screen text and then journal It on a printer
07 ASMLST: Full-sized Assembler Listing for AIM. Joeiswank
*3 ' Twenty-column listings are reformatted into full size
MICROCRUNCH; An Ultra-fast Arithmetic
83 Computing System, Part 2 John E.Hart
A discussion of software support for the fast mathematics hardware outline in Part 1
DOUBLE APPLE BONUS
49
50
59
62
66
68
71
75
79
Apple Graphics Ford Cavallarl
A quick overview of what's offered in our Apple Graphics Section
SHAPER; A Utility Program for
Managing Shape Tables Clement D. Osborne
Build shape tables by vector input
List Controller Preston R. Black
This program provides flexibility and ease of operatim when using the LIST command
Lo-Res Graphics and Pascal c. Donald Heth
Plot low resolution graphics using Pascal
Dollars and Sense Revisited David t. DeiiiOuadri
Learn to print formal in Applesoft BASIC using a MID$ statement
Paddle Hi-Res Graphics ..,KimG. woodward
Draw background scenes using paddles
True 3-D Images on Apple II Art RadcUffe
Create stereo-pair images without accessory devices
Apple Bits, Part 1 Richard C- Vile. Jr.
Aids for faster, more efficient low resolution graphics programming
Tracemark, An Apple II Debugging Aid Raymond weisiing
Understand complex problems with this study-tool utility
No. 40 -September 1981
MICRO - Ttie 6502/6809 Journal
V
X
» .
■
\^
.^
^
7
>
'A
^\
N^
#1 i
^
<(>
' Universatility,'
It's as easy as 1. 2. 3.
»
'Uni versatility' can be found in three versions
of Synertek Systems' SYM single board computer
— the versatile, universal evaluation board.
Over 2QJdQQ SYM-? boards have been used for
learning about and evaluating 6502 microprocessors
for specific applications. OEM SYM boards are used in
hundreds of products.
Now Synertek Systems presents the new SYM-l /68
for 6802 microprocessors, and the SYM-? /69 for 6809
microprocessors. These boards are designed to reliably
perform the same functions as the SYM-l board for
these popular microprocessors. Each SYM board is
complete and ready-to-use with its own version of
the 4K byte ROM SUPERMON monitor firmware.
Modification kits are also available to quickly and
easily convert existing SYM-I boards to SYM-I /6S or
SYM-I /69 microcomputers.
Build on your microprocessor knowledge with
the 'uni versatility' of SYM microcomputer boards from
Synertek Systems-
Every SYM-I . SYM-l /68, and SYM-l /69 single
board computer features:
• 28 double-function keypad with audio response
• 4K byte ROM resident SUPERMON with over 30
standard monitor functions and expandable for
individual requirements
• Up to 24K bytes of available program memory
• Expansion to 4K bytes of on-board static RAM
• Expansion to 71 Input/Output lines
• Single -i-5V power supply required
• Standard interfaces for audio cassette with remote
control, 1 85 bytes/second cassette format, TTY and
RS-232-C, system expansion bus. four I /O buffers,
and oscilloscope single-line display
PO. Box 552 Santa Clara, CA 95052
Synertek Telephone: (408) 988-5689
Systems TWX:9IO-338-OI35
Dealer inquiries invited.
•
About the Cover
■ f. ■ -^,
"v. >
■ —' ■■/■■^
..■■■■■ '-\
"i. — •-
V
Youi Own Roller Coaster!
What is more appropriate this time of
year than the midway at a stale fair or a
trip to the local amusement park? The
graphic on this month's cover is prob-
ably not immediately recognizable. But
then, it is our first three dimensional
live action graphic! As the photo sug-
gests, the graphic is of a roller coaster.
One of the bonus sections in this month's
issue is dedicated to Apple High Resolu-
tion Graphics. One article ;:overs the
unusual topic of three dimensional mov-
ing images. As an example, it shows a
roller coaster which you can see moving
aroimd its 3D track. So, "Whecece..."
Graphic from "True 3-D Images on
Apple 11" by Art Radcliffe
Photo by Robert Tripp
Thanks to Computer Mart of New Hamp-
shire for producing the graphic on their
equipment.
dUCftO is published monthly by:
MICRO INK, Int., Chelmsfoid, MA 01824
Second Class postage paid av.
Chelmsford, MA 1)1824 and Avon, MA
01322
USPS Publicalion Nurnbet: 4B,1470
ISSN; 0271-9002
Send subscriptions, change of address, USPS
Foim 3579, requests foi back issues and all
other fulfillment questions to
MICRO
P.O. Box 6502
Chelmsford, MA 01824
or call
617/256-5515
Sabscnplion lates Pei year
US. S18.00
Foreign surface mail $21.(10
Air mail:
Europe $36,00
Mexico, Central America S39 00
Middle East, North Africa S42.00
South America, Central Africa 151.00
South Africa, Far East,
Australasia $50,00
Copyrisht© 1981 by MICRO INK, Inc.
All Rights Reserved
/MCftO
EdHtorial
Readei Feedback
Many thanks to the readers who took
the time to fill out the questionnaire
we included in otn- July issue. We have
completed a preliminary analysis and
some of the results were very surpris-
ing. For instance, we knew that the
Apple was the most popular system
among our readers, but we didn't
suspect that the OSI portion was nearly
as high! The proportion of readers using
OSI systems at home is approximately
equal to that for Apple systems |35.4%
vs. 35.0%!, while the Apple systems
are used more at work |18.6% vs.
5.8%). The ALVI and KIM percentages
also came out a little higher than we
expected.
Another significant statistic is that
more than a quarter of our readers have
access to more than one system.
Because of this, the percentages below
add up to well over 100%.
AIM
Apple
Atari
KIM
OSI
PET/CBM
SYM
6809
Other
13.3%
50.0%
6.6%
14.6%
39-0%
12.4%
6.6%
4.4%
2-7%
Sixty-three percent of our readers
have had some formal training in com-
puters, whether it he a masters in com-
puter science or a night course in begin-
ning BASIC. The average hardware
level is somewhere between novice and
intermediate |43% novice, 44% inter-
mediate, and 12% expert], while the
average software level is distinctly
intermediate (19% novice, 62% inter-
mediate, and 19% expert).
Readers were asked to rate (with 1
the best and 5 the worst) the various
departments that appear in MICRO.
Specialized departments such as
Micros in Medicine, PET Vet, and the
OSI columns, have understandably
lower ratings because of the limited
number of readers they serve.
Software Catalog
Hardware Catalog
Editorial
Letters
2.3
2.4
2,5
2.5
New Publications
2.6
Bibliography
2.8
OSI columns
3.2
Clubs
3.8
Micros in Medicine
3.9
PET Vet
5.1
Articles overall received higher
ratings than departments. The biggest
sirrprisc was the lack of interest in
Pascal. Specific hardware and software
articles received high ratings, but often
notes were added; "1 if it's for my
system, 5 otherwise."
Specific software
1.8
Specific hardware
2.0
Programming techniques
2.0
BASIC
2.1
Applications
2.1
Assembly language
2.2
Tutorial
2.3
General software
2.4
General hardware
2.7
Pascal
4.0
These results are based on only 225
questionnaires. We have twice as many
more to process, and will he doing
more analysis to help guide our adver-
tising, promotion, and editorial efforts.
We'll keep you updated on new results.
Many readers made specific sugges-
tions and comments. While it is im-
possible to respond to all of these, you
can be assured they all will be read and
considered! Thanks again!
Canadian Subscribeis:
We hope you've received your
August issue by the time you read this.
[f not, don't despair — it is on the way.
Here's the reason for the delay; the post
offices here in the U.S. would not ac-
cept Canadian mail because of the re-
cent strike and subsequent backlog.
However, we will be sending the issues
August 17, and they should be in your
hands soon!
Letterbox
You'll notice that our letterbox sec-
tion rated high among readers answer-
ing the questionnaire. However, if you
check our table of contents this month,
you won't find it listed. Unfortunately,
we haven' t been getting enough general
letters to present Letterbox regularly.
We ask that you send us your com-
ments, gripes, or thoughts, so we can
rejuvenate this popular department.
U'^
f .-^
n
JJT
vJ-^
No. 40 -September 1981
MICRO - The 6502/6809 Journal
li
n
HI-RES Soccer S2B 95 no. $13.3*
'"'O'^f^' " M9 95 no- S43.««
Wursl o( Hunnngion Compuiing S1«.««
BPI IS<K> OFF LIST
Apple-Olds S29 95 „o„ $]S.39
Epson M-ao w/cafd & cable $STS.M
AuloPahn S29 9b now $11.39
Ml Comp Mulri-Furclion CarQ l9%eFFLIST
Gobbler ,,.. S24 95no» $11.19
On- Line Compile' , ,, II%OFFLIST
VU#3(Revi5edl ll%eFFL»T
Batller Cruiser Action S39 95 no« S33.M
UllifTia S39 95 no« S33.»«
Gorgpn $39 95 no- $33.««
Super Stellar Trek , $39 95 no™ $33.9«
WordStar _ $37 5 00 now $lB«.O0
UailMerge , $12500™^ $I06.I«
SuperSort ,, $200 00 rrow $ia«.99
Sentence □ I ag ramming .-,...., $19 95 now $l*.99
Black Beauty $34 95 now $39.*9
Moby Dick ....^ $34. 95 now $19.«9
Dymarc Surge Suppressor , $33.99
Ml Hike n Math
ta% OFF LIST
I IHlLNTINeT'CN C€MIPiLirilNe
BiBSIISiEiilSSISfiili PROGRAMS listed below are on DISK:
IS
B
B
n
n
13
B
n
B
Q
B
Q
B
li
B
IS
B
li
B
B
Gamma Goblins $2995/iow $1S.39
DBUaster .,, $22900/.o« $194.39
Tlie Data Facloiy S1 50.00 i.o« S 1 2«.oa
Mission Asteroid $19 95 now S1T.M
Wizardry 139.95 no« $33.M
Brrght Pen $49 95 „„» $43.49
Star Mines $29.95 now $23.39
PFS (Personal Filing System) $95 00 now $ao.*9
PFS Report $95 00 now $8«.*9
WarpFaclar , $39.95 -low $33.99
MicrosoH Adventure $29 95/w* $14.»9
Compu-Matii- Arithmetic $49 95 no« $44.93
Modifiable Database II , $150 00 now SI3T.49
TG Game Paddles $39 95 no- $33.99
TG Jo/ Slick $59 95 no- $se.»«
The WizarO 8 The Princess $32 95 no* $18.99
Flight Simulator (disk) S34.95 now $39.30
cwyssey , sag 96 now sas.so
Sargon II $34 95 ^w $19.70
Program Line Editor $40 00 now $34.99
Space Eggs $29.95 now $13.39
ViOe* 80-Col Board $350 00 now $399.00
3D Super Graphics $39 95 now $13.99
Compu-Math I or II , ,$40 00 now S34 ea
HI-RESCnbbage $24 95 now $11.99
Lords of Karma (cassette! S2000nD« $14.99
ApplePIESFormatterlReg. $129.95) Special $99.99
The Booliof Software $19.95 now $17.99
Versa Wr lie r Expansion Pac- 1 $39 95 now $33.99
Apple II Users Guide , .$14 95 rrow $11.99
Oh Shoot! $19.99
Serendipity SlatiElics or Gfaflebook . , $169.00 now $143.39
ABM (Muse) $24.95 now $31.49
Computer Contlicl $39 95 now $33.99
Computer Air Combat $59 95 now $33.99
The Temple ol Apshai $39.95 now $33.93
Super- Ten II $150.00 now $130.09
Request _ $225.00 now $191.19
Thinker $495.00 now $41O.09
Super Kram , , $175.00 now $148.49
Zork $39 95 now $33.99
Howardsofi Real Estate Analyzer $150 Oo now $119.99
Super Disk Copy-Sensible $30.00 now $13.49
The Landlord $795 now $449.99
NibOle Express $12.95 now $1 1.99
All Nibble Software 13% OFF LIST
All Creative Compuiing 19% OFF LIST
AllProgiamma 13% OFF LIST
nobolWars 13%OrFUST
Cranston Manner 13% OFF UST
Hayden AS Compiler $200.00 now $169.99
Beneath Apple DOS Book $20.00 now $17.99
Sublogic Animation PacK , is% aH If ■!
Me mo rex Disks lOlor $34.99
Pascal Programmer $125.00 no- $104.19
WEC 12' Green/Black S260 no- $319.00
VERBATIMDiSKS|Datalitew/hubnngs-unmarked)Ter(or . . .$37.99
Spanish Hangman , S29.95 now $30.99
Dragons Eye S24 95 now $11.19
Computer Acquire $20.00 now $14.99
Twalas Last Redoubt , $29.95 now $33.39
Snoggle $24 95 now $31.19
D C. Hayes Modem $379 00 now $399.00
Dala Capture 4.0 S60 00 no» $33.99
"Clock" Time Teaching Program , S29 95 now $14.99
Alien Ram $24 95 now $11.19
Alien Typhoon .$24 95 now $11.19
Raster Blaster $29.95 now $33.39
Payroll , _ $395 00 no- $333.49
Home Money Minder .,, _ S34 95 no- $39.49
3-D Skiing .,,,., S24 95 no- $31.19
Dr Daley's Soltware Library $79 95 no- $49.99
Physics I (Educ Courseware) $24 00 no- $31.49
JSS Computer Chemislr7 Si5000no- $139.99
Cook s Touch Typing $14 95 no- $13.49
EAI Literal Comprehension (grades 2-4) ,,.,.., $39 95 no- $33.99
COMPAK MATH Grade by Concept $495 00 now $443.49
Helltire Warrior S39 95 now $33.99
Mimco Joy Slick .... 560.00 now $34.99
Paper Tiger 5G0G . S1795.00now $1499
Mt Com Music System . , _ $545.00 now $479.00
Staiistics (Eflu-ware) $29.95 mo- $13.39
Algebra I (Edu-warel _.i,,.,.. $39 95 now $13.99
Apple Crate $59 95 now $34.89
Creature Venture , , , $24 95 now $31.19
G alaxy Space War I $39 95 no- $31.99
DOSBOSS $2400no- $30.39
Apple Barrel S29 95 no* $33.19
Apple Roots . S39 95 now $33.99
Interlude _ SI9 95now $10.99
ALL INTERACTIVE MICROWAflE 13% aH lltt
Meteorites in Space $19 95 now $14.99
Letter Perfect $i4995nD,v $117.39
VisiCalc 3.3 $199.95 no- $149.93
Visiplol $179.95 now $131.89
Visitrend $259.95 now $110.89
Visidei $199.95 now $149.93
Visitefm $149.95 now $117.39
MicrosoftTyping S19.95now $14.99
ASC II Express S99.95 now $84.99
Easy Writer Professional $250.00 now $119.00
ALL AVANT GARDE . 13% aH ll*t
DRAGON FtRE 13% aH lUt
Ed Courseware Basic Tutor 1 -6 . .
$38.19 an.
g Special Birthday Sale For Two-Vear-Old computer users
To celebrate our daughter Melody's second binhday, we are offering one of the best
games we've seen anywhere at a special price. DVNACOHP, maker of exceptionally
tine computer software, makes a game called HOQGE PODGE for children ranging
from under two years old to primary grades Children learn ihe letters of Ihe alphabet,
words, numbers, musical scales, songs and animals The child presses any key on
the keyboard and something happens. For example, when 'D" rs pressed, a dog
appears who frowns when a bathtub comes into sight - all lo ihe tune of "'Oh Wfiere
Has My Little Dog Gone ' Our Melody loves it and lumps up and down in excilemeni
when she plays it It s a chance tor her to finally get at the computer after watching
Mommy and Daddy use 11 all day. It's Ihe only program we know of lor children that
young It runs on (he Apple 11" plus (Applesofl") and needs 4BK plus a disk drive. It
lists for $23 95 hut if you say Happy Birlhday Melody "you can have it for SIS 99. We
know you ft like it We think it's fantastic
g HUHTIMCTON COMPUTING
a Post Oflice 80x787
Corcoran. California 93212
Border by Phone 800-344-41 11
_ In California (209) 992-5411
SUPER DISCOUNTS
[appkz'
SOFTWARE
in California (209) 992-5411 ^§f|-T'"- |P|| '^-'^''^ f^^-^-t-i-Mo change
Wt lake MasterCard oi ^ISA [include card
» and expirdlion dare) CdlilQima re&idenls
add 6''c lax incfude S2 OO for postage
Foreign and hardware exira Send tor Iree
caiaiog Prices suDieci lo change
The ultimate APPLE® copy program
COPY II PLUS
VERSATILE — Copy II Plus copies multiple
formats — DOS 3.2, 3.3, PASCAL,
FORTRAN, and CPM.
FAST — Copy n Plus copies diskettes in less
than 45 seconds. That's faster than most
other copy programs. Written entirely in
ultra fast assembly language.
Software, Inc.
or check
95
Search no more for that truly versatile, fast
copy program. Copy II Plus is the most
advanced copy program availahle for the
Apple II Computer. Compare capability,
compare speed, compare price, then call or
write to order Copy II Plus. Requires Apple 11
with 48K and at least one Disk Drive.
P.O. Box 3563
Centra) Point, OR 97502
(503) 773-1970
Deliveries from stock. No C.O.D.'s
Apple is a registered bademark of Apple Computer, Inc.
•
•
Terrapin Turtle
Be one o! the iirst persons to own your own robot. It'siun, nnd
unhfce other pets, the Turtle obeys your commands. It moves,
draws, bhnks, beeps, hasasanse oi touch, and doesn't need
lo be housebroken. Vou and your Turtle con draw pictures,
navigate mcRes, push objects, map rooms, and much, much
more. The Turtle's activities are limited only by your imagina-
tion, providing a challenge lor users ol all ages, interlaces,
including software for easy control of Ihe Turtle, are available
lor the Apple, Aton,andS-iOObusi:QmpiiterE,
Terrapin will give a free Turtle to the person or persons who
develop the best program for the Turtle by March 31, 1932, In
addition, Terropin will pay royalties. For more mlormation,
writeorcoll;
Terrapin. Inc.
678 Massachusetts Avenue
Cambridge, MA D2139
(617)492-8816
Books available from Terrapiri
Turtle Geometry by Abelsonand diSesso
An innovative book using Turtle Graphics to explore
geometry, motion, symmetry and topology, MFT Press $20.00
Mindstorms by Seymou r Papert
An exciting book about children, computers, and learning.
Explains the philosophy of the new LOGO language. Basic
Books $12. 95
Artiticiallntelligence by Patrick Winston
t'xplores several issues including onolysis ol vision and lan-
guage. An iniroduclion to the LISP language is incorporated
in the second section. Addison-Wesley$l8.95
Katieandthe Computer by Fred D'Ignazio
A children's picture book adventure about a young girl's
imaginary trip inside a computer. Creative Computing $6.95
Small Computers by Fred D'lgna7,io
A book about the future of small computers and robots, aimed
at adolescents. Franklin Waits $9.95
No. 40 -September 1981
MICRO - The 6502^309 Journal
Jumps and the 6502
The 6502 microprocessor
provides a variety of methods for
Jumping and branching. Several
of these methods are not
obvious, and can be very useful
to the assembly language
programmer. A little-known bug
in the JtMP INDIRECT Instruction
is also discussed.
Mark Bernstein
12 Oxford Street
Cambridge, Massachusetts 02138
Personal computers are powerful tools
for program development, and many
programmers have used them to dis-
cover the pleasures of machme and
assembly language programming. Since
cunent microprocessors are relatively
slow, and the available languages
[especially BASIC] are even slower,
many other computerists find them-
selves forced to use assembly language
routines simply to get the job done. For-
tunately, personal computers are power-
ful tools for developing assembly
language routines.
Since the personal computer is com-
pletely dedicated to its user, developing
machine language routines is simple and
often pleasant. Load a monitor or assem-
bler, type in a section of code, and nm
it! If the program is correct, the results
will be as expected. If the program is
wrong, testing will reveal incorrect or
unexpected results. Looking at the pro-
gram listing should uncover the defect.
However, certain instructions are
fraught with special difficulties.
Whenever an instruction transfers con-
trol from one segment of program code
to another, the instructions responsible
must be perfect the first time. If an LDA
or SBC instmctioa is misplaced or oper-
ates on the wrong address, the conse-
quence will probably be a wrong answer.
But if a IMP instruction teHs the compu-
ter to execute nonsense, the machine
will probably require a complete reset,
hoius of typing may be lost, and (worst
of all) no record of the run will be pre-
served to help the programmer.
Not only are control transfers tricky,
they are often the dominant considera-
tion in choosing a program's structtne.
A program that constantly jumps all
over the place without apparent rhyme
or reason will be difficult to imderstand,
A program that uses lots of subroutines
called by the JSR instmction is much
easier to understand, but may prevent
any practical use of the stack. On occa-
sion, special and even peculiar methods
of transferring control from one program
segment to another may be rewarding.
In the following discussion, I'll men-
tion numerous ways of fUMPing
through a program. The related issue
of conditional jumps or branches is
ignored.
The Simple Jump: )MP
The basic 6502, jump command is
simple, easily understood, and quite
useful. The syntax is simply
FROM JMP THERE
THERE...
if the computer executes step FROM, it
wUl jump to wherever THERE is. and
execute that instruction next. Of
course, it is vital that the address
THERE contain valid 6502 mstractions!
The Simple Subroutine: fSR
The (ump-Subroutine instmction
fSR is almost as simple as the JMP in-
stmction. When the computer executes
the command
FROM JSR SUBROUTINE
it jumps to the adtlress SUBROUTINE
and continues execution. Before it
jumps, though, it leaves a message on
the stack containing the address of the
next instruction following the fSR
command.
When (and if] the subroutine wants
to return control to the program that
called it, it can simply terminate with
the command
RTS
which jumps to the address on the top of
the stack.
The usefulness of subroutines in
writing simple, efficient programs is too
familiar to discuss here. A common
problem, though, is what to do with the
machine registers (A, X, and Y) when
calling a subroutine.
In the simplest case, we might allow
the subroutine to alter any or al! of the
machine registers. This approach is fine
for many cases, but clearly inadequate if
the calling routine needs to preserve one
or more registers containing data, loop
counters, or other vital information.
ngun 1: Arrangament of registers on
stack alter transfer of control.
£.
STACK
POINTER
zz:
gsKc^'-. -:.
return Isb
/..•:..:•"
^
address msb
/
MICRO - The 6502/6809 Journal
No. 40 -September 1981
•
•
Alternatively, we may insist that the
subroutine preserve all registers. To do
this we may [and nonnally must) use
the stack. All subroutines begin with a
sequence:
PHA (save the A register)
TXA
PHA (save the X register)
TYA
PHA (save the Y register)
and end with the conesponding se-
quence:
PLA (retrieve the Y register)
TAY (put it bacit into Y)
PLA (retrieve the X register)
TAX (put it bacl< into X)
PLA (retrieve the A register)
RTS
Note that the order in which registers
are placed on the stack is important.
The registers must be reloaded in exactly
the reverse order in which they were
pushed onto the stack. The sequence,
"push A, then X, then Y" is standard
and has the advantage of storing the
registers in alphabetical sequence.
The programmer may take a page
from the authors of the SYM monitor by
ending all subroutines with a [MP to a
special routine RESTORE:
JMP RESTORE
RESTORE PU\
TAY
PLA
TAX
PU
RTS
Each subroutine must push the registers
itself. This may be usefully written as a
MACRO if the prograimner's assembler
is sufficiently powerful.
There are two drawbacks to this
method of preserving registers. First, all
control transfers are slowed rather
drastically by all this pushing and pull-
ing from the stack. Moreover, if
subroutines are deeply nested, or
especially if they are recursive, (that is,
if a subroutine calls itself], all the extra
registers on the stack may accumulate
and exceed the 5502 stack capacity |256
bytes). A stack overflow is almost cer-
tain to cause a crash, and may be
miserably difficult to detect if it is unex-
pected. Of course, each routine could
check the stack pointer and abort the
program if an overflow is imminent, but
this checking adds still more overhead
to the control transfer.
hi addition, a program that uses the
stack extensively for storing registers and
subroutine return addresses must be
very cautious in using the stack for
anything else. In particular, a sub-
routine must never leave more or less
data on the stack than were present on
the stack when the subroutine was
called. If the subroutine wants to leave a
value on the slack, it cannot simply
push it there:
LDA ANSWER
PHA
RTS
for the computer will treat ANSWER as
part of its return address!
To avoid this disaster, it is possible
to manipulate the stack more carefully.
First, the return address is pulled from
the stack and stored somewhere in
memory. Next, the answer is pushed on-
to the stack. Finally, the return address
is replaced on the stack. Notice that if
the registers are saved on the stack, they
too must be peeled off, stored, and then
replaced. Even when the registers don't
need to be preserved, the resulting code
may seem a bit clumsy:
PLA (save the return address)
STA BUFFER 1
PLA
STA BUFFER2
LDA ANSWER
PHA
LdA BUFFER2 (replace the
return address)
PHA
LDA BUFFER1
PHA
RTS
Note also that the calling program or
subroutine must remove the result
ANSWER from the stack. If some pro-
gram segment forgets to do this, disaster
is likely to follow.
The Relocatable )ump
Occasionally, it is important to
write a routine which will run, regard-
less of where it is stored in memory. For
example, some utility programs are
designed to be stored in the highest
available memory locations of a user's
computer, regardless of how much
memory he actually has.
A normal absolute jump, though,
needs to know the address to which the
program should jump! If the program is
moved in memory, the jump commands
stiU point to the old locations. Of
course, a computer program (called a
relocator] could be written to search out
all the absolute jumps and change them,
but relocators are difficult to write and
easy to fool.
The normal method of evading this
difficulty on the 6502 is to use a branch
instruction which always branches.
Since the carry flag is changed infre-
quently, the most common sequence is:
SEC (force the branch)
BCS THERE (aiways branches)
Since branches can only jump (up or
down) 127 bytes, this technique favors
programs with only short-range jumps.
When required, though, a sequence of
jumps can move control over longer
distances:
SEC (start jumping)
BCS ISLAND (go to ISLAND
on the way to THERE)
ISLAND
THERE
SEC
BCS THERE
SeU-Modifring Code
On occasion, it is necessary or con-
venient to compute the address to which
the computer shotJd jump. An obvious
analogy is the BASIC statement:
ON I GO TO xxx,xxx,xxx
Provided that the program is (at least
partially] stored in RAM and not in read-
only memory, it is perfectly possible to
change the address of a IMP or (SR
instruction,
LDA DESTINATION
(least signiticant byte)
STA JUMP -I- 1
(store into the JMP instruction)
LDA DESTINATION + 1
(most significant byte)
STA JUMP -F 2
JUMP JMP...
If required, we could obtain DESTINA-
TION from a table, compute it from a
formula, or enter it fcom a terminal.
This approach is not without its
hazards. First, it is dangerous. If the
wrong address is stuffed into the JMP in-
struction, garbage is likely to be ex-
ecuted. If the computer is unlucky, the
garbage will crash the computer,
necessitating a system reset, which will
erase all traces of the offending error.
No. 40 -September 1981
MICRO - The 6502/6309 Journal
FIgum 2: Illustration of bug In S502 " JMP Indirect" tnstrucllon.
JMP (03FF)
0401
0400
03FF
03FE
1 1
33
The computer should
look for an address in
these locations . . . .
0301
0300
02FF
88
But, instead the
computer looks at
these locations.
Second, many programmers feel thar
data [things which are computed) and
procedures | instructions which are per-
formed] should be rigorously segregated.
Preserving the separation of program
and data improves clarity and helps en-
sure the integrity of both. Finally, many
programs may need to be transferred to
read-only mem.ory at some point in their
livesi clearly wc cannot alter an address
which is stored in read-only memory!
To use a self-modifying procediu-e in
a read-only memory system, a copy of
the self-modifying subroutine may be
stored in ROM and transferred to
read/write memory when the system is
initialized. This approach is adopted by
Microsoft in its 6502 BASIC. The
subroutine NEXTCHAR, which obtains
each character in sequence from the
BASIC soiurce program, is transferred
from ROM to part of memory page zero
whenever the system is turned on or
reset. Sections of BASIC, and many ex-
tensions to Microsoft BASIC [like the
"Programmer's Toolkit" produced by
Palo Alto ICs Inc.] modify jumps in this
routine.
While the above discussion used the
]MP instraction as an example, it
should be clear that the JSR instruction
is equally suitable for use in a self-
modifying sequence.
ladiiect Jumps: |MP (addr)
A further method of selecting the
address to which control will be
transferred is the indiiect jump:
JMP (WHERE?)
WHERE? is an address in memory which
contains the first 8 bits of a 16-bit
number. When the computer executes
the indirect jump, it goes to the address
stoied in WHERE? The effect is identical
to the self-modifying jump described
above. The code is cleaner and easier to
follow.
JMP (indirect] is also one of the most
dangerous instructions of which the
6502 is capable.
Unfortimately, a confusing design
decision (otherwise known as a bug}
limits the usefulness of the indirect
jump coimnand. If WHERE? happens to
be stored in an address ending in hex-
adecimal $FF (for example, at $03FF],
the 6502 makes a bizzare and confusing
jump. The programmer expects the
computer to look at WHERE? for the
least significant byte of the jump ad-
dress, and at WHERE? + I for the most
significant byte. Unfortunately, the
6502 does not carry when executing the
JMP indirect instruction, and will look
for the high-order byte not at
WHEREt + 1 but at WHEREi-$FF if
WHERE?'s address ends in $FF.
Fortunately, if the programmer
knows and remembers this hazard, it is
not too difficult to avoid. First, he can
simply choose to locate all targets (like
WHERE?) at addresses which do not end
in SFF. Since indirect jumps are relative-
ly uncommon, this is often perfectly
reasonable.
Second, a self-modifying sequence
will perform correctly. The disadvan-
tages may be worthwhile if the time loss
is not critical.
However, on rare occasions neither
approach is fully satisfactory. An in-
teresting example is the design of the
6502 FORTH language for the FORTH
Interest Group (by W.F. Ragsdale). Here
an indirect jump figures prominently in
a cmcial routine, which must run as
quickly as possible since it is called dur-
ing every single step in the FORTH pro-
gram. Ragsdale resigns himself to check
each and every possible target for the
IMP indirect instmction, and relocates
the whole program by a few bytes to
move any offending addresses. For-
tunately, there is only one chance in 256
that a given address will offend. The
10
MICRO - The 6502/6809 Journal
No. 40 - September 1981
•
•
programmer has some chance of getting
away with ignoring this bug if he simply
relies on luck.
Using RTS to Perfoim a Jump
RTS, of course, is normally used to
terminate a subroutine. It performs two
pulls from the stack, and iumps back to
the address indicated by the two bytes it
pulls. !n normal usage, this returns con-
trol to the instruction that follows the
JSR which originally invoked the
subroutine.
Suppose a subroutine needs to return
to an address different from that which
called it. For example, we might define a
subroutine called KEYBOARD that
behaves as follows:
Subioutine Keyboard
1. Get the next key depression from the
keyboard.
1. Convert the key code to an ASCII
character.
3. Is the key the SYSTEM RESET key?
(a)linol, then return normally [like a
subroutine), fbj If so, return to the
system monitor. Do not leave any
junk on the stack!
End Keyboard
One way to implement step i3bj
would be to fetch and discard the top
two entries on the stack, and then use a
simple JMP:
PLA (throw out the return
address!)
PLA (leaving the stack where 11
should be)
JMP MONITOR
Alternatively, the address of the
monitor could be put onto the stack as if
it were put there by a }SR instruction.
PLA {throw out the old return
address, as before)
PU\
LDA #L,MONiTOR
PHA
LDA #H, MONITOR
PHA {put address of monitor onto
the stack)
RTS {go to the monitor)
Of course, a subroutine can also
change the return address of the
subroutine that called it, by looking
deeper into the stack. For example, we
mi^t have a subroutine WHAT-NEXT?
that decides what the highest priority
task for the computer is, and changes
the return address.
Subroutine WHAT-NEXT!
1, Set pointer to DO-NOTHING.
2, Check all sensors.
3, If the room is on fire, set pointer to
FIRE!
4. If the room is wet, set the pointer to
FLOOD!
5. If the power is failing, set the pointer
to FAMINE!
6. Change the return address of the
routine that called WHAT-NEXT? to
the routine indicated by the pointer.
7. Return to whatever routine called
WHAT-NEXT?
A common jump usually performed
using the RTS instruction is the abort
exit. Often, it proves necessary to abort
a program immediately upon detecting
an error. If the program is called from
BASIC or a machine language monitor,
the usual method of exit is simply an
RTS instruction.
If a subroutine must abort the pro-
gram, it must be able to return to the
master routine |e.g. BASIC), not simply
to the routine that called it. If the pro-
gram saves the stack pointer when it is
first called
START TSX {stack contains exit
address)
STX ABORT
then any subroutine, regardless of what
other data may be on the stack, can
abort execution and exit by restoring the
stack pointer:
QUIT
LDX ABORT
original pointer)
RTS {back all the way to
BASIC)
Software Interrupt:
The BRK Instruction
The BRK instruction allows an
interrupt- request to be generated by the
program itself. When the computer en-
coimters a BRK, it takes the following
steps;
1. Stores the status register and the
current execution address ■^ 2 on the
stack.
2. Sets the BRK flag in the status
register.
3. Sets the IRQ Inhibit flag in the status
register.
4. Performs an indirect jump via hex-
adecimal addresses $FFFE-$FFFF,
The BRK instruction is most often
used to jump to the system monitor.
Since its opcode (00] is a cotmnon ele-
ment in data tables, a program running
amok has a fair chance to encounter a
"BRK instruction" and so, retinn con-
trol to the monitor. Also, by writing
BRK's on top of normal machine code, a
simple software-controlled breakpoint
monitor may be implemented and sim-
ple tracing performed.
Microcomputers, including the
6502, have simple interrupt structures,
which cannot accept too much work.
Moreover, the obstacles which make
jumps difficult to debug make interrupt
routines almost intolerably tedious to
develop on most personal computers.
Hence, use of the BRK routine should
not be imdertaken lightly.
On occasion, though, BRK comes in
handy, either when a special monitor-
like routine is to be invoked, or for
debugging normal interrupt service
routines. Whenever you use it, be sure
to remember that RTI will retimi to the
calling program, skipping a byte after
the BRK, BRK is really a two-byte opera-
tion. Also, remember that BRK inhibits
interrupt requests. Some machines,
notably the Commodore PET, use inter-
rupt requests to check the keyboard or
display. A mysteriously non- responsive
system may result.
restore Changing the IRQ or NMI Vectors
The subject of interrupt handling is
too complex to be considered here.
However, changing the interrupt service
routine vectors can be a valuable tool in
several programs, and must be mention-
ed in the context of control transfers.
Most 6502 systems place the IRQ
and NMI vectors in ROM, but use an in-
direct jump (explicit or via self-
modifying code) through a RAM loca-
tion to service interrupt requests (IRQs],
The programmer may alter the RAM ad-
No, 40 - September 1981
MICRO - The 6502/6809 Journal
11
diesses to point to his own service rou-
tines. Frequently the user's IRQ service
routines end by jumping to the normal
[system] IRQ routines. For example:
BEFORE I
IRQ VECTOR — T
SYSTEM IRQ SERVICE
AFTER j
IRQ VECTOR —J
USER'S ROUTINE — >
SYSTEM IRQ SERVICE
Several computers generate periodic
interrupts to service their keyboards,
displays, or other peripherals. Qther
systems possess 6522 timer facilities
which may be user-programmed to gen-
erate such mterrupts. Setting the IRQ
service vector to point to a user routine
ensures that the new routine will be ex-
ecuted within a fixed period of time.
For example, I recently required a
modified IRQ routine for the Commo-
dore PET. The PET'S screen is only 40
characters wide, and a program has to
provide extended text messages and
graphics simultaneously. The answer
was to scroll the messages across one
line of the screen in the manner of a
stock-ticker display. The PET generates
IRQs every I/60th of a second. When
the program had a message to send, it
would add a new letter to the left end of
the display line, three times a second.
As long as more letters remained in the
queue, the user IRQ routine was called.
After the entire message was sent, IRQ
handling reverted to normal until more
text was placed in the queue.
I should add that, whenever this pro-
gram failed while it was being tested, it
would leave a stream of amusing but
useless text, cycling endlessly across the
message line. The only way to stop the
thing was to tum off the power!
The author gratefully acknowledges
the support of the Merck Foundation,
whose award of a Merck Foundation fel-
lowship helped make this work possible.
Mark Bernstein is a graduate student in
Chemistry at Harvard University. His
research in picosecond laser spectrost:opy,
under the direction of Professor Kevin S,
Peters, is assisted by several
microt:omputers. His most recent project
has been implementing a FORTH-like
language for laboratory data acquisition
and analysis, based on an expanded
Commodore PET.
iUCftO
WHICH EDITING "SMART-TERMtNAL" MONITOR ROM
IS BEST FOR YOUR CI P?*
OMIER" - fOIT BHSIC
MOR V SI
BASIC LIERS I DN 1
YGHt^lSF? BV nlCBOS
_ . t C Q
?§ ROPI-TEfiM HUE EDITING
la E» COLUMH OISPLHV HMO
l^l-OPPV DISK BDOTBTHfH'
ROM-TERM
1 H 1
P0»»IFOH
rlOEO
[] EDIT BBitH
COPVSILHT
1991
ItlCPO IXlElfFClCC
Pf HOV^ia nOTKE
THE *e ^OLUHH DISPlOi' ""3* '«
SERIES 1 ]
Gl-P-
svHTO): E"OB^ ftK ors^ii-'fti
CDRBECTL'
PLSO. THERE 1^ 4 HEtt PfDnt" 1
VEADT^-
ROM-TERM II
FEATURES AVAILABLE ON BOTH ROMS AT THE TOUCH OF A KEY;
• Enter-SrrartTe'mmar' mode tor communications with a time Share Dial-up con-puler
network
• Select half-duplejt/full-duplex operation.
• Select auto or manual line teed al carnage return.
• Transmit a pre-prepared memory file trom C1 P to remote corrputer: THis memory tile
can be a fnessagc lette' or program and is sent at full speed - savmg time and
telephone expense. Programs can be listed to memory file while in basic
• Receive a message or program (orall transactions! infoa memory file lorlater review
on video, recording on tape and printing The file can be downloaded to basic alter you
e«il the "snia't terminal" n.ode
• uptoading/downloadmg of programs can be done in this memory file manner or
directly into basic liy using a new serial output distributor and a new ■'Control-L" load
command.
• Return to Basic program operation al the same poinl of eneculion from which you
entered the 'smart-terminar' mode
• -Smart-Terminar mode can be utilized with the modem/telephone disconnected in
order lo prepare memoryfiles. type directly to serial printer, send memory files to printer
or tape and to view tapes without interference from basic "Syntax Error."
• The serial output distribulorcan be turned on and off with a "controls" keystroke or with
a poke which allows easy control of a serial printer from basic.
• Basic program lines can be recalled, edited and re-entered. The editing includes
backspacing, forward spacing, deleting, typing over, inserting new text, and
changing line * (duplicating a linet. During editing, Ihe cursor position and display are
wrapped around, allowing operation on and displaying of an entire line up to 72
characters long The preparation of line numbered messages can utilize these features
— e"tremely handy for poor spelling typists like me'
• Keyboard has been completely corrected to provide standard typing format. By the
use of the control and repeat keys as modifiers, any character in the full USASCll 1 28
Character set can be entered from the keyboard. This will give you all the
characters you need for running Pascaland other high level languages inaremote
computer.
• Video output may be halted at any lime for easy uiewing.
• Screen clear at keystroke
ALL FEATURES ARE nOM RESIDENT AND ALWAYS AVAILABLE AT POWER ON.
ADDITIONAL FEATURES PROVIDED IN THE ROM-TERM
• Disk bootstrap - In disk operation you can alternate between ROM Basic and Disk
Basic with a keystroke Can Warm Start Disk Basic.
• Easytransferofprogramsbetweendiskand ROM Basic, fuse the ROM Basiclorediting
disk basic programs.!
• IWemory files can be stored or recalled in Disk Basic, ROM Basic or the "Smart
Terminal" interchangeably
ADDITIONAL FEATURES PROVIDED BY ROM-TERM ii"
• A48 column i/ideodispiay on series IIC1PfRevision-D"Superboardl Selection of 48or
24 column video with a "Control-V" keystroke Corrected ■Synla- Error" n-essages .
■RECOMMEND THE ROM-TERM II FOR NON DISK OPFRATION OF SERIES II C1P lOR
REVISION "D" SUPERBOARDl AND THE ROM-TERM FOR ALL OTHER SYSTEMS.
ROM-TERM AND ROM-TERM 11 ARE A LOT MORETHAN JUST "SMART TERMINAL- ROMS.
THE EDITING MEMORY FILE ANDOUTPUT DISTRIBUTOR FEATURES ARE INVALUABLE.
EASY INSTALLATION JUST PLUG INTO REGULAR C1P MONITOR ROM SOCKET
ONLY 159 95' ORDER NOW Check with your Local Dealer. Phone orders/Visa/MC accepted
Sent Postpaid on prepaid Domestic orders
MICRO-INTERFACE
3111 SO. VALLEY VIEW BLVD., SUITE 1-101
LAS VEGAS, NEVADA 89102
Telephone: (702) 871-3263
12
MICRO - The 6502/6809 Journal
No. 40 -September 1981
M
M
M
M
END FRUSTRA TIOM!
FROM CASSETTE FAILURES
PERRY PERIPHERALS HAS
THE HDE SOLUTION
OMNIDISK SYSTEMS (5" and 8")
ACCLAIMED HDE SOFTWARE
• Assembler, Dynamic Debugging Tool.
Text Output Processor, Comprehensive
MemofY Test
• HDE DISK BASIC NOW AVAILABLE
PERRY PERIPHERALS S-100 PACKAGE
Adds Omnidisk (6") to
Your KIM/S-100 System
• Construction Manual— No Parts
• FODS & TED Diskette
• $20. +$2. postageSt handling. (NY re*idenM
add 7% tax) (specify for 1 or 2 drive ivatemi
Place your order with:
PERRY PERIPHERALS
P.O. Box 924
Miller Place. N.Y. 11764
(516)744-6462
Your Full-Lina HDE Didributor/ Exporter
•
OSI Disk Users
Double your disk storage capacity
Without adding disk drives
Now you can more than double your usable floppy
disk storage capacity— for a fraction of the cost
of additional disk drives. Modular Systems'
DiskDoubler ''is-a. double -density adapter that
doubles the storage capacity of each disk track.
The DiskDoubler plugs directly into an OSI disk
interface board. No changes to hardware or
software are required.
The DiskDoubler increases free user disk space
from 50K to I20K for mini-floppies, from 201 K to
4aOK for 8-inch floppies. With the DiskDoubler,
each drive does the work of two. You can have
more and larger programs, related files, and disk
utilities on the same disk — for easier operation
without constant disk changes.
Your OSI system is an investment in computing
power. Get the full value from the disk hardware
and software that you already own. Just write to
us, and we'll send you the full story on the
DiskDoubler, along with the rest of our growing
family of OSI -compatible products.
Modular Systems
P.O. BaxIBA Dradell, NJ D7B43
20-1-2S2-DOS3
•
S 75.00
S 20,00
$ 45,00
$ 45.00
t 65 00
S 14,95
$ 99,95
$109,95
$ 74,95
$29,95
I 39.95
Z-FORTH IN ROM byTomZimmer „ „ ^,
510 10 times faslerllian Basic, Once you use il, you'll never go back lo BASICI
source listing add
OSI FIG-FORTH True tig FORTH model fof 0S65D with fig editor named liles, string
package & mucii more
TINY PASCAL Operates in tIg-FORTH, an exceptional value wtien purcfiased with lorth.
TINY PASCALS, documentation
FORTH S. TINY PASCAL
SPACE INVADERS 100% maclilne code for all systems with 64 chr, video Full color S sound
on C2, 4P 8 8P systems. The fastest arcade program available.
PROGRAMMABLE CHARACTER GENERATOR ^, ^ , , . „
Use OSI's graphics or make a complete set of your own! Easy to use, comes assembled S tested.
2 Mhz. boards
PROGRAMMABLE SOUND BOARD ,, ^,
Complete sound system featuring the AY-3-e910 sound chip. Bare boards available.
32/84 CHARACTER VIDEO MODIFICATION
Oldest and most popular video mod. True 32 chi. GIF, or 32/64 chr C4P video display.
Also adds many other options.
ROMS!!!
Augment Video Mod with our Roms. Full screen editing, print at selectable scroll, disk support and many more
features Basic 4 & Monitor J |f=^
Basics * 133=
All 3 for * SS"0
65D DISASSEMBLY filANUAL by Software Consultants. First Class throughout,
Amust for any 650 user, * ^^-^^
NUMEROUS BASIC PROGRAMS, UTILITY PROGRAMS AND GAMES ALONG WITH HARDWARE PROJECTS. ALL
PRICES ARE US FUNDS. Send lor ow SI. 50 catalogue with free progranHhardcopy) Memory Map and Aulo Load
Routine.
OSI Software & Hardware
3336 Avon a ale Court
Windsor, Ontafio. Canada N9E 1X6
(619)969-2500
3281 CountryBidB Circle
Ponliac Townsliip, Michigan 48057
1313) 373-048B
No, 40 -September 1981
MICRO - The 6502/6809 Journal
13
GRAPHICS
FOR OSI COMPUTERS
^ You Can Produce The Images
Shown Or Yours And Program
Motion Wfth Our 256 By 256 High
Resolution Graphics Kit. ^_
Thats 65,536 Individually Controlled
Points On Your TV Screen.
iz Increase Column/Line Display.
You Can Set Up Your Own Graphic
Pixels Including Keyboard Characters
And Unlimited Figures.
iV This Kit Includes All Parts, Software
And Assembly Instructions Required
To Get Up And Running.
The Included 8k Of 2114 Memory
Is Automatically Available When
Not Using The Graphics.
Boot Up And See 8k More Memory.
it Adding The Kit Does Not Affect^
Your Existing OSI Graphics.
Use Both At The Same Time
Or Separately.
^ Buy The Entire Kit,
Including Memory, For $ 1 85.00
Or A Partial Kit For Less If You
Have Parts. Board And
Instmctions $40.00. Instructions
Include Software.
SjQm
For This Kit Or A Catalog
Of Otiier Kits, Software
^nd Manuals Call Or Write:
MITTENDORF ENGINEERING
905 Villa Neuva Dr.
Litchfield Park, Az. 85340
(602)-935-9734
The Disk Switch
•
t
The Disk Switch will add many
hours of useful life to your
diskettes, extend the life of your
disk drives, and even save
energy!
Nelson E. Ingersoll
6910 S. Bannock n
Littleton, Colorado 80120
In the last year I have become very
familiar with my OSI minifloppy
system. I have learned its graces, and I
have learned its faults. One of its faults
is that OS! minifloppy drives have the
nasty habit of eating diskettes.
Minifloppy drives have spindle
motors which turn the diskettes inside
their protective jackets. Depending on
whether the head is loaded, data can be
transferred from the rotating diskette to
the system. When the disk head is load-
ed it actually comes into contact with
the diskette.
This contact of the disk head with
the rotating diskette is very hard on the
diskette. It slowly wears away the oxide,
which ultimately results in the destruc-
tion of the diskette. However, MPI, the
company which makes OSI minifloppy
drives, is not blind to the plight of
diskettes. The MPI minifloppy drives
have included in their circuitry the abili-
ty to turn off the spindle motor when
the drive is not being accessed. MPI
recommends that their drives be turned
off two seconds (or ten revolutions of
the diskette] after the last access.
Regretfully, OSI minifloppy sy stems
do not do this- The MOTOR ON line is
permanently wired in the ON state. OSI
already had a working 8" floppy inter-
face with the necessary software to drive
it when they decided to mate a mini-
floppy with an OSI personal computer.
Redesigning the interface and software
would have cost a lot of money, and OSI
Figure 1
holdIE:
C2i
100uf~r 6
INDEX
INHIBIT
INDEX-INH
+5V
I.
R5
4ro
DS-* [H>-
DRIVE SELECT
INHIBIT
Kgti
04
470
-<^ INDEX
M
I
N
I
F
L
O
P
P
Y
Ds-eQ>-
: B
-O— O —
33^
-l^OS-B INH
4-5VDC
GND [1> 1
customers would have had to pay that
cost. So, OSI compromised. They kept
the same floppy interface and software,
added a few necessary modifications,
and passed the savings on to us.
Nonetheless, OSI made it imperative
that something like the Disk Switch be
designed. It is the job of the Disk Switch
to turn off the minifloppy spindle
motors when the drives are not being
No, 40 - September 1 981
MICRO - The 6502/6809 Journal
15
used. The Disk Switch works well for
both single and dual minifloppy
systems. It is reliable, and will extend
the life of the media you use in your OSI
system. Let's take a look at how the
Disk Switch works.
Theory of Operation
Figure I is the Disk Switch circuit
diagram . The Disk Swi tch mo nitors the
HOLD (Head Load) and STEP outputs of
the OSI floppy interface. Whenever
either of these two signals is active, the
Disk Switch activates the MOTOR ON
line, thereby turning ON the minifloppy
spindle motor.
The HDLD and STEP signals from
the floppy interface are Exclusive OR'ed
together by UlA, a 7486. The resulting
signal is used to trigger UlA, the
MOTOR ON 74LS123 one shot, into
producing a two to three second output
pulse. The output of the MOTOR ON
one shot is inverted by U3A, a 7438
ope n collector NA ND gate, to become
the MOTOR ON signal to the mmi-
floppy drives.
The MOTOR ON one shot and
associated circuitry is the heart of the
Disk Switch. All other fimctions of the
Disk Switch arc dependent upon the
correct operation of this circuit. The
74LS123 is used for U2 because larger
value resistors can be used in its timing
circuit, thereby allowing the use of
smaller capacitors. The 7438 open col-
lector NAND gate is used because it can
take the electrical load that the
minifloppy imposes on the Disk Swtich.
The Q output of the MOTOR ON
one shot also drives two other circuits.
The first is the INDEX Inhibit circuit;
the second is the Drive Select Inhibit
circuit.
INDEX is an output from the mini-
floppy drive which indicates the begin-
ning of a track. The OSI floppy interface
must have the Index signal. When Index
is missing, the system will wait for it —
forever if necessary. Thus, when there is
no Index, the system is locked up.
I used this requirement of Index
detection to give the spindle motor time
to come up to speed before allowing the
system to access the drives. The INDEX
Inhibit one shot is tri ggered at the begin-
ning of MOTOR ON. Its output will in-
hibit Index from getting to the floppy
interface for about one second.
While inhibiting Index in this man-
ner adds one second to the minifloppy
access time, it is not imreasonable.
Figure 2
:nifi!fiiil rimB!:i
K F A B
DEI C
r
O
A13 CABLE CARRIER
A - *5V0C liom *13. la
B- GNO (rom »13-ia
C - HOLO Irom *13, I
D- STEP Irom *13-5
E - MOTOR ON lo AI3-4 (cul iibc«I
F - INDEX linm A13-17 IcutUgcal
G- INDEX INH lo *13,17
H - DS-A Iram A13-3 Lcullractl
I - DS-A - INH ID A13-a
J - OS B Irom A13-1B Itullracul
K - DS B INH lo A13-18
R6 R5
-© ^
3 IJ1- laee
3 U3- 7*38
na R4
^ U2 - 711.S123
-©
-«
DISK SWITCH
Once an access has begun, the INDEX
Inhibit circuit will no longer affect the
operation of the access. Whether the
access is two seconds or twenty, only
one extra second is added by the INDEX
Inhibit circuit.
Note the wiring of the X-OR gate
UIB at the input of the INDEX Inhibit
circuit. In this configuration the X-OR
gate has the function of an inverter. It is
cheaper to get an inverter in this matmcr
than to add another chip to the parts list.
At the bottom of the circuit diagram
in figure I is the Drive Select Inhibit cir-
cuit. The Drive Select Inhibit de-selects
the minifloppy drives v4'hen they are not
being accessed. There are several
reasons for this. The most important
reason is to unload the disk head.
The disk head is loaded by the drive-
select input when it is active. Unloading
the head is useful in preserving the life
of the diskette, and the disk head itself.
An additional feature of the Drive Select
Inhibit circuit is that it lowers the power
consumption of the drive by placing it in
the stand-by mode.
In operation, UIC and UID invert
DS-A (Drive Select A| and DS-B (Drive
Select B| respectively. The inverted
drive select signals are fed into U3C and
USD, U3 is a 7438 open collector
NAND gate. The MOTOR ON signal on
the second inputs of U3C and U3D
prevents the drive sel ect signals fr om
being passed on unless MOTOR ON is a
logic high.
Whenever the minifloppy drives
have not been accessed for two seconds,
the MOTOR ON signal from the
MOTOR ON one shot is low. This low
at the inputs of U3C and USD forces
their respective outputs high. The high
output is the false or non-selected level,
and neither of the drives is selected.
An additional feature of the Drive
Select Inhibit circuit is that in a dual
minifloppy system it can be jumpered to
16
MICRO - The 6502/6809 Journal
No. 40 - September1981
•
cause the selection of drives A or B only.
This prevents the selection of non-
existent drives.
Note the jump er mar ked 'A' and 'B'.
In the 'A' position DS-B is enabled such
that its logical state selects dri ve B.
When the jumper is in position 'B', DS-B
is dis abled and the unin verted state of
DS-A selects drive B. This causes the
selection of drive B whenever drive A is
not selected. This feature will prevent
the accidental selection of non-existent
minifloppy drives C and D.
The Disk Switch can be simplifed by
removing the Drive Select logic. It is not
necessary to the operation of the Disk
Switch, but helps to prevent diskette
wear. In the event that the Drive Select
Inhibit circuit is not used, the inputs of
UlC, UID, U3C, and U3D should be
tied to + 5VDC.
Two of the four 470 ohm puU-up
resistors, R5 and R6, should also be
removed if the Drive Select logic is not
used. The pull-up resistors are
necessary, since the interface between
floppy and system is made with open
collector gates. In the case of the four
puli-up resistors, the associated signals
are not terminated anywhere else.
By no w you a re probably wondering
about the HDLD si^ml from the floppy
interface. What is it for? The answer is
simple — nothing! It is a relic of the
floppy interface software used with the
larger 8" disk dri ves. However, for our
heeds the HDLD signal is very useful.
Assume that you need to access a track
that has already been found. Since the
head is already positioned over the cor-
rect track, the system will not generate
a STEP signal. The only ind ication of
the access will be the HDLD signal.
9
Without the use of the HDLD signal
an access to the same track would not
trigger the MOTOR ON signal, the spin-
dle motor wouldn't spin, so the Index
signal would not be generated. There-
fore, the system would lock up waiting
for the Index signal . It was kind of OSI
to leave the HDLD signal lying around
like that.
Construction
I have aheady constructed several
versions of the Disk Switch, and have
installed the final version in three opera-
tional systems. All versions of the Disk
Switch that I have built easily fit on a 3
by 2 inch perforated circuit board.
I have used both wire wrap and
point-to-point soldering to construct the
Disk Switch. I do not recommend wfre
CBM/PET? SEE SKYLES ... CBM/PET?
"They laughed when I sat down
at my PET and immediately pro-
grammed in machine language. . .
just as easily as writing BASIC."
With the new Mikro, brought to you from England by Skyles
Eleclric works, always searchinfi the world for new products for PET/CBM owners. A
4K machine language assembler ROM Ihal plugs Inro your main board. Ai ju^l SRO.OO for
[he Mikro chip, \l doe^ all Jhe machine bnguaiC work for you; sli you have Eo do is slarl
laying down ihe code.
The Mikro retains all (he greai screen editing fealures of (he PET. , ,even all Lhe Toolkit
commands. (If you own a Tooikii, of course, | Sit down and write your own machine
language subrouLinc, The program you write is the source code you can save. And the
machine language monitor saves lhe object code. The perfect machine language answer
for most PET owners and for most applications. (Not as professional as [he Skyles Macro-
TeA, ,,ni>l as c^pensivc, eiEher,)
A great [earning experience for those new to machine language programming but who
want to masEer it easily. Twelve-page manual included but we also recommend the book,
"6502 Assembler Language Programming," by Lance A, Leventhal at 5t7.00 direct
from Skyles,
Skyles ^uaraniefs yaur sBfJsfaciion: if yon arc not absolutely happy with your new
Mikro, reEurn it to us within ten days for an immediate, full refund.
Skyles Mikrn Machine language assembler SSO.OO
"6502 Assembler LanguaK* Progrsmniing" by Leventhal IT.OO
Shipping and Hand/mg (USA/Canada) SI, SO fEurope/AsiaJ SIO.OO
Calif orniii residents must add 5^/tS^^ sales tax, as required.
Skyles Electric Works
23111: SouCh Whisman Road
Mounlaln View, California 94041
(415) 96S-I735
Visa/Maslereaird orders: call toll free
(880) 227-9998 (except California),
California orders: please call <41S)
965-1735.
/IAI90 ■" S31A>IS 33S 6l3d/l/\ia0"
wrap because of the posts that protmde
from the board. Wire wrapping the cir-
cuit is definitely easier, but the circuit
board must be placed in a tight location.
I suggest that the circuit be soldered
point-to-point. Since there are no high
frequency signals in the Disk Switch,
the actual layout is not critical.
The Disk Switch should be mounted
on the A13 floppy interface board to
facilitate wiring. The A13 board is the
cable carrier for the minifloppy cables,
and plugs onto the 505 CPU board.
Mounting the Disk Switch on the
A13 board is best since all of the signals
used are available there. Servicing the
Disk Switch is also much easier. The
only precaution is to make sure the Disk
Switch does not touch the 505 CPU, or
whatever board may be located nearest it.
Attaching the input and output sig-
nals to the Disk Switch is a relatively
simple matter. Just locate the appropri-
ate traces on the A13 board, make the
necessary cuts, and attach the wires. In
all cases, the wires from the Disk Switch
can be soldered into existing pads.
Figure 2 shows where to moimt the
Disk Switch on the A13 board. All trace
cuts are shown, as well as the locations
of the various connections to the Disk
Switch.
In conclusion I will leave you with a
word of caution. You have probably ac-
quired the habit of opening the disk
drive door when you don't need to ac-
cess the disk. It is a reasonable habit
that reduces diskette wear. With the
Disk Switch this is no longer necessary.
You should now leave the door closed
when you are using the system. Other-
wise, with the door open, the system
will miss the Index signal when you try
to access a disk. The Disk Switch will
time out, and lock you out of your
system.
There is a simple fix for this that you
might wish to try. You can add a pull-up
resistor and a grounding switch to pin I
of U2, the MOTOR ON one shot- This
would a llow you to i ndependently trig-
ger the MOTOR ON signal and restart
the minifloppy drive.
[If you don't feel up to the task of
constructing the Disk Switch, you can
obtain a kit from DStN Micro Products,
3684 N. Wells St., Fort Wayne, IN
46808. The kit contains all of the
necessary parts and costs $29.00 plus
$2,00 shipping and handling,)
Mcno'
No. 40 - September 1981
MICRO - The 6502/6809 Journal
17
Color computer owners
Yes, that's right - for as little as
$298.00 you can add 32K of dynamic
RAM, and a disk interface, to your
TRS-80 Color Computer! If you just
want the extra memory it's only
$199.00, and you can add the disk
interface later for $99.00.
Just plug the Color Computer In-
terface (CCI), from Exatron, into
your expansion socket and "Hey
Presto!" - an extra 32K of memory. No
modifications are needed to your
computer, so you don't void your Ra-
dio Shack warranty, and Exatron give
both a 30 day money-back guarantee
and full 1 year repair warranty on
their interface.
The CCI also contains a 2K
machine-language monitor, with
which you can examine (and change)
memory, set break-points, set memo-
ry to a constant and block-move
memory.
So what about the CCI Disk Card?
Well as we said it's only an extra
$99.00, but you'll probably want
Exatron's CCDOS which is only
$29.95 - unless you want to write your
own operating system. The CCI Disk
Card uses normal TRS-80 Model 1
type disk drives, and CCDOS will
even load Model I TRSDOS disks into
your color computer - so you can
adapt existing TRS-80 BASIC pro-
grams.
As a further plus, with the optional
ROM Backup adaptor, you can dump
game cartridges to cassette or disk.
Once the ROM cartridge is on cas-
sette, or disk, you can reload, examine
and modify the software. The ROM
Backup adaptor is only $19.95.
For more information, or to place an
order, phone Exatron on their Hot
Line 800-538 8559 (inside California
408-737 71 1 1). or clip the coupon.
excellence in electronics
exatron
DEALER ENQUIRIES INVITED
Exatron,
181 Commercial Street,
Sunnyvale, CA 94086
n Please send a 32K Color Computer
Interface for $199.00
D Please send a CCI Disk Card for $99.00
D Please include CCDOS and manual
for S29.9,'j
D Also include a ROM Backup adaptor
for $19.95
Please add $5.00 for shipping to all orders,
and 6 percent sales tax in Calitornia.
Name
Address
City
Stale Zip
Charge my:
U MasterCard Interbank Code
nVisa Expiration Date
Card
D Check enclosed for
D Ship COD ($2.00 extra)
I
Signature
•12K RrtM plus Disk InlcrfaCP THS-fll ia ^i Iriid.'nmrk of Tandy
-STOP BUYING THOSE "CANNED" SOFTWARE^<
J PROGRAMS THAT TURN OUT TO BE COSTLY, W
A INEFFECTIVE AND INCOMPLETE. FINALLY THERE V
IS ONE SYSTEM, ONE SYSTEM THAT CONTAINS ALL THE ^■
^ POWER, ALL THE VERSATILITY YOU'LL NEED TO MAKE V
A PROGRAMING FASTER. SIMPLER AND ERROR FREE. C.O.R.P.™ V
IS AN APPLICATION GENERATOR THAT ACTUALLY WRITES ALL
^ THE SOFTWARE (COMPLETE APPLESOFT PROGRAMS THAT EXECUTE V
INDEPENDENTLY OF THE C.O.R.P.™ SYSTEM AND MAY BE MODIFIED BY THE ^
USER) BASED ON INFORMATION SUPPLIED BY THE USER IN ENGLISH. COMPLETE
PROGRAM GENERATION TAKES ONLY MINUTES.
t
THE FIRST ONE, NOT THE LAST ONE
IN PROGRAM GENERATORS
C.O.R.P.™ CONSISTS OF 5 MAJOR SUBSYSTEMS: A DATA ENTRY PROGRAM GENERATOR
^ A SORT SUBSYSTEM, A UPDATE SUBSYSTEM, A PRINT GENERATOR AND A COMPLETE '
DIAGNOSTIC PACKAGE . TOGETHER THE 5 SUBSYSTEMS MAKE C.O.R.P.™
'V THE MOST ADVANCED, COMPLETE AND USEFUL TOOL AVAILABLE FOR
—YOUR APPLE II'. ALL FOR THE INCREDIBLY LOW PRICE OF $189.95**. -
^ DOLLAR FOR DOLLAR C.O.R.P.™ IS THE BEST BUY IN TOWN! '^
■m NO OTHER PROGRAM GENERATOR OFFERS YOU SO MUCH
^ VERSATILITY FOR SUCH A SMALL PRICE. TO PURCHASE
"^C.O.R.P.™ SYSTEM BRINGTHIS ADTO YOUR
',_ LOCAL DEALER OR WRITE US DIRECTLY. ,
•
MAROMATY & SCOTTO SOFTWARE CORP.
P.O. BOX 610 FLORAL PARK, N. Y.1 1001
© Copyright 1981 Maromaty & Scotto Software Corp.
■APPLE is a Registered Trademark of APPLE COMPUTER, INC.
■"Plus Handling and Shipping, N.Y. Slate Residenis please add Sales Tax.
It's Time to Stop Dreaming
Part 4
By Robert M. Tripp
Pans 1 and 2 (MICRO 37:07 and
MICRO 38:271 of tl^is series introduced
the 6809 microprocessor. Part 3
(MICRO 39:16) described the 6809 in-
struction set from the 6502 user's point
of view. That topic was easy to cover
since there are so many similarities be-
tween the two micros. This month's ar-
ticle discusses the addressing modes of
the 6809, and was more difficult to
write. While the 6809 and 6502 do share
a number of common modes (although
often the nomenclature is different], the
6809 offers a number of new modes
which will take some getting use to for
the 6502 devotee. These additional
modes are very significant and con-
tribute a lot to the overall functioning of
the 6809. So, the effort involved in
understanding them is well spent.
Common Modes
The following modes are essentially
identical between the two micros. The
name for each mode is different, but the
processing is identical,
IMPUED oi ACCUMULATOR (6502)
and INHERENT (6809)
This mode is used when the effective
address of an instruction is "implied" or
"inherent" in the instruction itself. Ex-
amples on the 6502 are CLC (clear carry
bit in status register], INY (increment Y
register), RORA (rotate accumulator
right, and so forth, "Accumulator" is
another form of "implied." Examples
on the 6809 are ABX (add B register to X
register), CLRA (clear A register), and so
forth. The basic addressing element of
this mode is that any registers which
will be affected are specified within the
opcode and do not require additional
information.
IMMEDIATE
The "immediate" mode is identical
on the two processors. It takes as its ef-
fective address the location(s) im-
mediately following the opcode. On the
6502 the immediate data is always 8 bits
since that is all that the 6502's registers
can handle. On the 6809 the immediate
data may be 8- or 16-bit, For example, an
LDA #$05 would be 8 bits into the A
legister, but an LDX #$1234 would load
16 bits into the X register,
ABSOLUTE (6502) and ,
EXTENDED 16809)
These two modes are identical. The
effective address is provided in the two
bytes following the opcode, LDA $1234
will load A from the absolute /ex tended
address $1234. This mode of addressing
permits the processor to directly access
any location in its 64K addressing space,
ABSOLUTE INDIRECT (6502) and
EXTENDED INDIRECT (6809)
The only instruction on the 6502
which can use the absolute indirect
addressing mode is the JMP, Any other
instruction which requires an absolute
indirect mode must either set the X
register to zero and use the indexed
Indirect mode LDA |ADDR,X], or set
the Y register to zero and use the In-
direct Indexed mode LDA (ADR),Y. The
6809 does not require such chicanery,
but provides the Extended Indirect mode
for all major operations, such as LDA
(lUNKj. This makes indirect addressing
much simpler.
ZERO PAGE (6502) and
DIRECT PAGE (6809)
These two modes are conceptually
similar, and, for the zero page of
memory, are identical. On the 6502, any
address in page zero may be absolutely
referred to by providing only the low 8
bits of the address, with the mode de-
fined by the opcode specifying that the
high 8 bits are all zero. This makes
accessing the 256 locations on page zero
faster and requires only one byte of
addressing instead of two.
The 6809 carries this concept of only
providing the low byte of the address a
bit further. Instead of forcing the high
byte of the address to zeros, it has a
separate register called the "Direct Page
Register," which contains the high byte
of the address. If the DP register is set to
zero, which it is automatically on
RESET, then a "duect page" mode
reference will be identical to the 6502
"zero page" mode. But, the DP reigster
may be changed to any other value,
allowing the directly referenced page to
be anywhere in memory!
This function can be very useful.
First, it removes the limitation of only
256 bytes of directly addressable
memory. Second, and probably more
significant, it will support multiple
tasks and multiple users. Code can be
written which makes all task /user
references in the direct page mode. By
setting the DP register to a different
value for each task/user, there will be
no conflict and multiple tasks/users can
easily share the same program code.
One other addition to the 6809 mode is
that fMP and JSR instructions are per-
mitted via the Direct page.
RELATIVE (6502 and 6809)
This mode is used on both micros for
the Branch operations. The data follow-
ing the branch opcode is added to the
Program Counter (PC| to determine the
effective address for the branch. On the
6502, the signed data is limited to one
byte, providing a branch range of 127
locations forward and 128 locations
backward. The 6809 permits the signed
data to be either one byte, in which case
20
MICRO - The 6502/6809 Journal
No.40-Seplemberl98l
•
•
it is identical to the 6502, or two bytes,
in which case any address in the normal
64K addressing space is accessible.
The 8-bit mode is called a "short"
branch and the 16-bit mode is called a
"long" branch. {Note: Several years ago
the savings associations of Red Bank, N]
and Long Branch, NJ were planning a
merger, but it fell through because they
did not want to be known as the Long
Branch Branch of the Red Bank Bank!
But, I digress.) Since the 6809 has a
Branch to Subroutine and a Branch
Always, the value of the long branch is
even geater since fSRs and [MPs can be
replaced by the relative BSRs and BRAs.
INDEXED Addressing on the 6502
Since the 6502 has 8-bit index
registers, its indexing can only cover a
range of 256 bytes and the 16-bit base
address for all indexing operations must
come from somewhere else. This may
be an ABSOLUTE 16-bil address as in
LDA JUNK,X or STA IUNK,Y. It may be
a PAGE ZERO address which assumes
the high 8 bits to be zero and directly
specifies the low 8 bits as in LDA
fUNK,ZX or CMP fUNK,ZY. Or, it may
be one of the two special modes which
combine indexing and indirect addressing.
INDEXED INDIRECT uses X as an
index to a set of Page Zero byte-paiis
which are 16-bit addresses to the final
effective address anywhere in memory.
An example is ADC |IUNK,Xj which
will take the byte-pair that is X loca-
tions above JUNK in Page Zero as the
effective address for the operation.
INDIRECT INDEXED uses a Page Zero
byte-pair as the 16-bit address of the
start of a 256-byte section of memory
which is indexed by Y. An example is
SBC iJUNK|,Y which will take the
16-bit value of JUNK and fUNK + l in
Page Zero and add to it the current con-
tents of Y to form the effective address.
All of the indexed address modes are
not available for all instructions, which
while not fatal, can be a nuisance. Have
you ever written a clever piece of code
based on an D^JC |fUNK],Y only to find
that there is no such animal?! Although
the designers of the 6502 gave us some
very useful indexed addressing modes,
they were limited by the fact that the X
and Y registers are only 8-bit.
INDEXED Addressing on the 6809
The best way to understand the 6809
indexed addressing modes is to fhst
forget all about the 6502's, While there
are some similarities, they are out-
weighed by the great differences. So,
let's depart trom the comparative
evaluation of the 6809 and look at the
index addressing from scratch.
One of the most important features
of the 6809 is that its index registers are
all !6-bit. A second significant feature is
the multiple index registers: X, Y, S, U,
and sometimes PC. That's right! The
two stack registers, S and U, can per-
form all of the indexing operations, and
the program counter, PC, can be used in
several special index operations. This is
quite different from the 6502 with its
two 8-bit index registers. There are three
major categories of indexed addressing
modes which can use the X, Y, S and U
registers.
Constant Offset from X, Y, SoiU
In this mode, a constant value is
added to the contents of the specified
index register to form the effective
address. This is similar to the Absolute
Indexed mode of the 6502: LDA
JUNK,X in which )UNK is a 16-bit con-
stant value to which is added the cur-
rent value of X to form the effective ad-
dress. The 6809 supports this 16-bit
mode of constant offset, but also pro-
vides three other modes: No offset,
5-bit offset, and 8-bit offset. Since the
index register is 16 bits, it can contain
the entire effective address. It makes
sense, then, to have a mode in which
the contents of the index are used di-
rectly without any additional constants.
The instruction of the form LDA ,X on
the 6809 will use the current contents of
X as the effective address.
There are many instances in which
the offsets required are within a limited
range. For example, if an index points to
the base address of a VIA device which
has 16 internal registers, only foin bits
of offset would be required to access all
registers. Why use 16 bits when fewer
will suffice (especially if you can save
time and space with a smaller value]?
The 5-bit constant offset of the 6809
provides for a signed offset which can
cover the range of + F to - F locations
from the 16-bit index. The format of the
instruction is the same as for the 16-hit
constant offset: CLR JUNK,Y but fUNK
is now a 5-bit or less signed value.
.'S imi larly, the 6809 provides an 8-bit
constant offset . It covers a range of + 7F
to - 7P locations hom the 16-bit index.
In summary, the 6809 provides four
forms of Constant Offset indexing; No
Offset, 5-bit Offset, 8-bit Offset and
16-bit Offset. Each mode of increasing
the number of bits requires either more
instruction cycles, more instruction
bytes, or both.
Accumulator Offset from Index Register
The 6809 can use one register to
index another. Any one of the accumu-
lators, A, B, or D, can be combined with
the X, Y, S OT U registers. The instruc-
tion form is INC B,U which will per-
form a two's complement addition of
the B register and the U register to form
the effective address. All combinations
are valid and may be used for all major
operations. The Accumulator Offset
mode can be very powerful in perform-
ing table lookups in which the position
within the table is calculated by some
routine and then implemented through
this indexing mode. The A and B
registers provide 8-hit signed offsets; the
D register provides a 16-bit signed offset.
Auto Increment/Auto Decrement
One very common use of an index is
to step through a set of values. This is
used in searching a table, moving a
number of bytes from one location to
another, and so forth. The 6809 provides
four modes which either increment or
decrement the index register as part of
each operation. All four index registers
may be used. They may be incremented
or decremented by one when used for
stepping through a table of single bytes,
or may be incremented or decremented
by two when working with 16-hit
words, such as addresses. The form of
the single increment is LDA ,X -i- in
which X has the 16-bit address which is
used by the instruction as the effective
address, and which is then incremented
by one after the operation has taken
place. The double increment form is
LDA ,'i + + and the register is in-
cremented twice after each operation.
The decrement modes work in an
identical fashion except that the decre-
ment is done before the operation. If X
contained $2000 at the start of a decre-
ment instruction such as LDA , - X then
the value loaded into A would come
from location SIFFF, A double decre-
ment instruction would be STA , S.
Note that the minus sign|s] in the decre-
ment comes before the register and that
the plus sign(s) in the increment comes
after the register. This indicates the
order of the operation: decrement before
the operation and increment after the
operation.
Program Counter Relative Addressing
The previously discussed indexing
modes all use the X, Y, S or U registers.
It is very important in writing position-
independent code to be able to refer to
data in a position- independent manner.
One way this is supported on the 6809 is
No. 40 - September 1981
MICRO - The 6502/6809 Journal
21
Indexed Addressing Mode Summary for the 6809
£
Type
Forms
Non-lndiiect
Indirect
Constant Offset from R
(2's Complement Offsets)
No Offset
5-bit Offset
8-bii Offset
16-bit Offset
,R
n,R
n,R
n,R
[.R|
defaults tc
|n,R
|n,R
8-bit
Accumulator Offset from R
|2's Complement Offsets)
Auto Increment/ Decrement
Constant Offset from PC
(2's Complement Offsets)
Extended Indirect
A Register Offset
B Register Offset
D Register Offset
Increment by 1
Increment by 2
Decrement by 1
Decrement by 2
8-bit Offset
16-bit Offset
16-bit Address
A,R
B,R
D,R
,R +
,R+ +
,-R
,--R
n,PCR
n,PCR
xxxxx
|A,R
|B,R
|D,R
not allowed
l,R++|
not allowed
i,--R|
[n,PCR|
In,PCRl
In]
NOTES; R is X, Y, S or U register.
Extended Indirect is not an
index mode but is included
in the
table for the sake of completeness on the
Indirect Addressing
forms.
through an indexing mode which uses
the current value of the Program
Counter Register |PCR) as the base for
calculating the effective address. There
are two forms of this mode: 8-bit offset
and 16-bit offset. These two modes are
identical except for the size of the offset.
LDA JUNK,PCR will add the 8-bit or
16-bit offset of "JUNK" to the current
value of PCR to calculate the current
location of JUNK. This is identical in
concept to the Relative Addressing used
by the Branch instructions. Combined
with the Load Effective Address instruc-
tion, this mode permits the easy loading
of an index register with the relocated
address of a table, LEAY TABLE,PCR
will put the absolute addresss of TABLE
into the Y register where it can be used
by the other modes of indexing to access
the entire table.
INDIRECT Addressing on the 6809
All of the indexing modes discussed
above, with the exception of the Auto
Increment One and Auto Decrement
One, can also have a level of Indirect
addressing. This means that all of the
calculations which go into producing
the Effective Address take place as
usual, but then this Effective Address is
used to access a location which contains
the final Effective Address. This pro-
vides many modes for implementing the
Indexed Indirect which the 6502 sup-
ports in a limited maimer for the X
register only.
The indirect Indexed mode, which is
very important on the 6502, is not need-
ed as such on the 6809- Since the 6809
has a variety of ways of getting the cor-
rect 16-bit address into one of its four in-
dex registers, there is no real need for
the "indirect" portion of the mode.
Why specify an address "indirect" on
page zero as in the 6502 when it can be
specified "direct" so easily on the 6809?
The "index "portion of the mode is, of
course, supported by all of the normal
6809 indexing modes.
Summary
This fom-part series has presented
an introduction to the 6809 micro-
processor as seen throtigh the eyes of a
6502 user. If it has encouraged you to
find out more about this potential suc-
cessor to the 6502, then the series has
served its purpose. As an admitted
novice on this particular micro-
processor, I have tried to make an ac-
curate presentation of the major features
of the 6809, but may have made some
mistakes! If you are serious about using
this device, 1 recommend that you ob-
tain the MC6809 or MC6809E data
sheet from your Motorola represen-
tative!.
I am actively working with the
6809E on the Flexi Plus board that my
sister company The COMPUTERIST,
Inc. introduced in August 1981. I am
sure that I will be finding out a lot more
about this micro and will write addi-
tional articles as needed. Meanwhile,
several very knowledgeable 6809 com-
puterists have offered to write articles. It
will obviously take time to get our
coverage of the 6809 rolling, so, if you
have 6809 information to contribute,
please cont act me.
6809 SYSTEMS (^1 6809 SYSTEMS (^ 6809 SYSTEMS (^1 6809 SYSTEMS
(51
pr ^— ^-
Gimix
Jht Cgmpaitf that dutUtn
QuBlHy EJecrronic ofOHucta since JS7S
Fealurmg Ihe GIMIX mainlrama wild 30 amp C.V. iBrra-fesonanl power supply, litteen 50 pin and eighl 30 pin slol Mother Board;
2 mi GPU «.ilh lime ol day clock S baHeiy back-up, IK HAM, 68m ptogrammable Iimer, pioviSiDns lof 9511A or 9512 For further mlamtm. orlcingsnO Brocrtuies, contact
Anlhmelic prpcessois. and A PROM/ROM/FfAM sockets Ihal can liold up lo 3^KB ol munitpf m user soflware
VARIETY- you can have 33KB. 56KB. 128KB anO up ol sialic RAM. Vou Mn use i and/or 8' disk drives, single or double
density, single or douDie sided, and single or doude iraoKmg with GIMIX disk contrpliers. You have a wide ctioice ol ssnal or
parallel i/O cards
EXPANOABiny; Vou can add meniory, l/Os. VWeo m Gfaptiics cards, Ariltimelic procEssofs, adflilioiial flrue capacity, and other
HarDware now oi in me lutLije to Ifiis ES5D bus siruclured system Irom GIMIX or olbei SS50 bus compatible maniilaciurafs 1337 WEST 37lh PLACE. CHICftQO, IL60609
SOFTWARE VERSATILITY: GIMIX syslems can use TSC'S FLEX or UNIFLEX and MICFIOWARES OS-9 opeiating syslems. A wide (312) 9Z7-5S10 • TWX 9iO-2Z1-W5S
variety ol soHware and languages is available lor itiese syslems ,„,=w™n iiinpm=rt!i
DUALITY: All boatfls ate assembled, burned-m, and tested and leature GOLD PIATEO BUS CONNECTORS. Only top quality com- '^""* liGim iT
ponenls ate used and all beards are lully buttered lor inaiitTiutr system expansion. All boards t^otre complete with bus connectors
and all nEcessary instruction and documentalion. Fiei anO Jniile. are iraOEmarks ol Tsrhnicat Systems
GIMIX designs, manufactures and lests. inhouse. their complele line ol products, ComplBle systems atB available to fit your Consulliinr^ inc 059 i^ a irademark ol Micro*ara Inc See
needs Please contact \t\e lactory i1 yoii have any special requirements.
ineir 3D b I or oihEr EIMIX comiidiiiiie ^oliwarE.
22
MICRO - The 6502/6809 Journal
No. 40 - September 1981
A TEAM OF 6809 SUPERSTARS:
Smoke Signal's Chieftain™ Computer,
and Software by IMicroware
HERE'S THE TOTAL 6809-BASED SYSTEM TOR THOSE WHO DEMAND
UNSURPASSED POWER, fLEXIBIUTY AND RELIABILITY
After years of worldwide use in diverse and challenging appli-
cations, the outstanding performers in 6809 computer opera-
tions are SMOKE SIGMAL and MICROWARE. These leading
companies are recognized as the undisputed choices whea
there is no room for compromises.
WHY snout SIGNAL APiD niCROWARE LEAD
THE 6809 riELD
Smoke Signal began pioneering research and development on
6800/6809-hased computer systems back in 1977. Microware
worked three years to perfect OS-9 and BAS1C09.
Both companies have evolved outstanding 6809-based
products from early engineering research, and both pay
almost fanatical attention to detail. For example . , .
SMOKE SiariAL'S 6809-based Chieftain'" computer series has
proven its superiority in hundreds of demanding tasks. From
gold-plated connectors to high est -quality materials throughout,
each Chieftain'" Is built to deliver absolute dependability from
day one, and stay that way through years of service.
4EHDUIIANCECERTIFTED ^
^l^n-nl q Luilbry tiiiil T/i iww.i
r ittitl piM" I iri^ irrifir^
iPinpuiiriil h lln' ihl cir
Every Chieftain™ is meticulously
EnDURAnCE-CERTIFIED at 2.2 MHz.
That's SMOKE SIGNAL'S endorse-
ment of product perfection.
MiCROWARE's state-of-the-art 05-9 UniX'-liKe operating system
and the BASIC09 language have been developed in close
coordination with computer manufacturers to masimize
optimum system performance. The finest possible support and
"UMX is a trademark of Bell Telephone Laboratories.
SMOKE SIGNAL
BRUDCISTING
mOKM/APtE
31336 VIA COLINAS
WESTLAKE VILLAGE, CA 91362
TEL (213) 889-9340
documentation further ensure satisfaction. Microware software
performance is best summed up in this remark by a 25-year
computer veteran:
"BASIC09 IS Wr. ritiEST tllQti-LEVEL LAHGUAGE I'VE EVER
SEEH in TtiE imusTmr
Thousands of engineers and programmers use MICROWARE
software products as their standard time-saving tool ... to
eiLCCute process-control applications , . , and for other vital
functions. CORGI, and PASCAL are also available under the
OS-9 operating system.
HOW THIS REnARKABLE TEAPI OF COnPUTER
SUPERSTARS CAM SERVE YOV
SMOKE SIGriAL's Chieftain'" computer provides an array of
configurations ranging from 5W-inch drives for single-user
applications to multi-user, multi-tasking capabilities. Winchester
hard-disk drive systems are also available.
In other words, breathtaking power with as little as 48k
memory; Mictoware's 05-9 level Two can access up to one full
megabyte that your Chieftain'" can address!
One more sampling of the awesome processing potential
at your fingertips with the Smoke Signal Chieftain'" computer:
MICROWARE'S Stylograph screen-oriented word processing
package instantly makes Chieftain'" an easy-to-use document
preparation system with comprehensive editing commands.
THERE'S nucn, nUCn nOREI Call or write SMOKE SIQMAL
for details on Chieftain" computers and MICROWARE software.
SliOKE SIGnAL Dealer opportunities are still available . . .
please request information.
D Send information about Ctiieftain'" computers
and Microware software.
n Provide information about Smoke Signal's Dealer program.
Name
Address.
City
. State..
-Zip.
Telephone i
The Newest In
Apple Fun
We've [aken five of our mosi popular programs and
combined Ihem info one tremendous package full of
fun and e;icilemen[. This disk-based pm:kage now of-
fers you ihese greal games:
Mimk — How good is your memory? Here^s a chance
Lo find oul! Your Apple will display a sequence of
figures on a 1 X 3 grid. Vou mus! respond wilh the ex-
act same sequence, wilh in ihe Lime limil.
There are five differcnl, increasingly difficult ver-
sions of [he game, including one that will keep going
indefinitely. Mimic is exciting, fast paced and
challenging — fun for all!
Air Flighl Simulalion— Your mission: Take off and
land your aircraft without cra.shing. Vou're n>tng
blind — on instruments only.
A full lank of fuel gives you a maximum range of
about 5Q miles. The computer will constantly display
updates of your air speed, compass heading and
altitude. Your most important inslrumeni is the Angle
of Ascent /Bank Indicator. It tells if the plane is climb-
ing or descending, whether banking into a right or left
turn.
After you've acquired a few hours of flying lime,
you can Iry flying a course against a map or doing
acrobatic maneuvHs, Gel a Utile more llight time
under your belt, the sky's the hmit.
Colonnaster — Test your powers of deduction as you
try to guess the secret color code in this Mastermind-
type game. There are two levelsof difficulty, and three
options of play lo vary your games. Not only can you
guess the eompulH's color code, but it will guess
yours! El can also serve as referee in a game between
two human opponents. Can you make and break the
color code . . . ?
S(w Ship Atl»ck— Your mission is to protect our or-
biting food slalion ralellites from destruction by an
enemy star ship. You must capture, destroy or drive
off the attacking ship, if you fail, our planet is
doomed . . .
Trllogj— This conlcsl has its origins in (he simple
game of tic-tac-loe. The object of the game isio place
three of your colors, in a row, into the delta-like, mul-
ti-level display. The rows may be horizontal, vertical,
diagonal and wrapped around, through the "third di-
mension". Your Apple will be trying to do Ihe same.
You can even have your Apple play against iiselfl
Minimiun system requirements are an Apple 11 or
Apple li Plus compulcr with 3IK of memory and one
minidisk drive. Mimic requires Applesoft in ROM, all
others run in RAM or ROM Applesoft.
Order !No. D161AD S19.9S
Solar Energy For The Home
With the price of fossil fuels rising astronomically, solar space-heating systems are starling to become very
altracEivc. But is solar heat cost-effective for you? This program can answer that question.
Just input this data tor your home: location, siie, interior delails and amount of window space. It will then
calculate your current heat loss and the amount of gain from any south facing windows. Then, enter the data
for the contemplated solar heating installation. The program will compute the NET heating gain, the cost of
conventional fuels vs. solar heat, and the calculated payback period— showing if the investment will save you
money.
Solar Energy for Ihe Home: It's a natural for architects, designers, contractors, homeowners. . .anyone
who wants to tap the limitless energy of our sun.
Minimum system requirements arc an Apple 11 or Apple II Plus wilh one disk drive and 28K of RAM.
Includes AppleDOS 3.2.
Order Mo. 023SAD (disk-based versloni SM.95
Math Fun
Paddle Fun
This new Apple disk package requires a steady eye and a quick hand at Ihe game paddles! It includes:
Invmkis — You must destroy an invading fleet of 55 flying saucers while dodging the carpet of bombs Ihey
drop. Your bomb shelters will help you — for awhile. Our version ofa well known arcade game! Requires Ap-
;Jesoft in ROM.
Howitzer — This is a one or two person game in which you must fire upon another howitzer position. This pro-
gram is written in HIGH -RESOLUTION graphics using different terrain and wind conditions each round to
make this a demanding game. The difTiculty level can be altered to suit Ihe abilily of Ihe pjayets. Requires Ap-
plesoft in ROM.
SpBM Wbis— This program has three pans: (1) Two flying saucers meet in laser com bat— for two players, (2)
two saucers compete to see which can shoot out the most stars — for two players, and (3 1 one saucer shoots the
stars in order to gel a higher rank — tor one player only. Requires Applesofi.
Golf — Whether you win or lose, you're bound to have fun on our 18 hole Apple golf course. Choose your
club and your direction and hope to avoid the sandiraps. Losing too many strokes in ihe water hazards? You
can always increase your handicap. Get off the tee and onto the green with Apple Golf. Requires Applesoft.
The minimum system requiremenl for this package is an Apple li or Apple II Plus computer with 32K of
memory and one minidisk drive.
Order No. 0163AD S19.95
The Math Fun package uses the techniques of immediate feedback and positive reinforcement so that
students can improve their math skills while playing these games:
Hanging— A little man is walking up the steps to the hangman's noose. But YOU can save him by answering
the decimal math problems posed by the computer. Correct answers will move the man dov/n the steps and
cheat the hangman.
Spellbinder — You are a magician battling a computerized wizard. In order to cast death clouds, fireballs and
other magic spells on hitti, you must correctly answer problems involving fractions.
Whole Sp»ee— Pilot your space crafi lo allaek the enemy planei. Each lime you give a correct answer to the
whole number problems, you can move your ship or fire. Bui for every wrong answer, the enemy gets a
chance to fire at you.
Carjump-Make your Slum car jump the ramps. Each correct answetwill increase Ihe number of buses your
car must jump over. These problems involve calculating the areas of different geometric figures.
Robat Duel — Fire your laser at the computer's robol , If you give the correct answer lo problems on calculat-
ing volumes, your robol can shoot at his opponent. If you give the wrong answer, your shield power will be
depleted and the computer's robot can shoot at yours.
Sub A ll»eli— Practice using percentages as you maneuver your sub into the harbor. A correct answer lets you
move your sub and fire at the enemy fieci.
All of these programs run in Applesoft BASIC, except Whole Space, whidi requires Integer BASIC.
OrdrrMo. 0I(I0ADSI9.9S
Skybombers
Two nations, seperated by The Big Green Moun-
tain, are in mortal combat! Because of Ihe terrain,
Iheir's is an aerial war— a war of SKYBOMBERS!
In this two-player game, you and your opponent
command opposing fleeis of fighter-bombers armed
wilh bombs and missiles. Your orders? Fly over The
mountain and bomb Ihe enemy blockhouse into dusi!
Rying a bombing mission over that innocent look-
ing mountain is no milk run. The opposition's aircraft
can fire missiles at you or you may even be destroyed
by Ihe bombs as Ihey drop. Desperate pilots may even
ram your plane or plunge into your blockhouse, sui-
cidally.
Flight personnel are sometimes forced to parachute
from badly damaged aircraft. As they float helplessly
to earth, they become targets for enemy missiles.
The greater the damage you deal to your enemy, the
higher your score, which ts constantly updated al Ihe
bottom of the display screen.
The sounds of bailie, from exploding bombs to the
pathetic screams from wounded parachulisls, remind
each micro-commander of his bounden duly. Press
On. SKYBOMBERS-Press l>i!
Minimum system requirements: An Apple EI or Ap-
ple 11 Plus, with 32K RAM, one disk drive and game
paddles.
Order No. 0Z71AD (disk-ba»d version) SI9.9S
Instant Software
■ A tradamark of Appla Computsr I ng.
PETERBOROUGH, N.H. 03458
603-924-7296
24
MICRO - THe 6502/6809 Journal
No. 40 - September 1981
t
Apple* Software
From Instant Software
Santa Paravia and Fiumaccio
Buon giorno, signore!
Welcome to the province of Santa Paravia.
As your steward, I hope you will enjoy your
reign here. I feel sure that you will find it, shall
we say, profitable.
Perhaps I should acquaint you with our lirile domain, ll ih noi a
weallhy arta, signore, bul riches and glory are possible for one who
is aware of pollEieal reallltes. These reahlies include your serfs. They
tonstanily requesi more food from your grain reserves, grain ihat
could be sold instead for gold florins. And should your Justice
become a irifle harsh, ihcy will flee lo oiher lands,
Yei another concern is iheweaEhcr. If it is good, so is the harvest.
But the rats may eat much of our surplus and we have had years of
droughl when famine Ihreaiened our population.
Cenainly, Ihe administration of a growing cily-state will require
lax revenues. And where better lo galher such funds than the local
marketplaces and mills? You may find it necessary to increase custom duties or tax
the incomes of the merchants and nobles. Whatever you do, there will be far-
rcachiuE consequences. , .and, perhaps, an elevation of your noble title.
Your standing will surely be enhanced by building a new palace or a magnificent
cairedrale. You will do well 10 increase your landholdings, if you also equip a few
imits of soldiers. There is, alas, no small need for soldiery here, for the unscrupulous
Baron Peppone may invade you at any lime.
To measure your progress, the official canographer will draw youarnappa. From
it, you can see how much land you hold, how much of it is under the plow and how
adequate your defenses are. We are unique in that here, the map IS Ihe territory.
I trust that Ihavebeenof help, signore. I loot forward to the day when I may ad-
dress you as His Royal Highness, King of Santa Paravia. Buona/or{unaov. as you
say, "Good luck". For the Apple 48K.
Order No. 01T4A OT.95 (CBSStHe version).
Order No. 0Z29AI) tl9.9S (disk version).
TO SEE YOUR LOCAL INSTANT SOFTWARE DEALER OR USE THE ORDER FORM BELOW
% ORDER
For Fast aA Iff^
Service^ Toll-Frce
1-800-258-5473
Apple Cassettes
0OI8A Golf 17.95
0025A Mimic 17.95
0O4OA Bowling/Trilogy. - $7.95
0O73A Math Tutor I $7-95
0I>79A Oil Tycoon $9.9!
OOSOA Sahara Wairiors $7.95
0O88A Accounting Assistant $7.95
0094A Mortgage w/Prepaymem Opiiott/
Financier --,.---... S7.95
0O96A Space Wars $7.9!
(109BA Math Tutor II 17.95
0I74A Santa Paravia and Rumaccio $9.95
OI'tflA Air Flight Simulation $9.95
We Guarantee It!
^yo Guarantee ^t,>-/^
OUR HROfiBAMS ARE GUARANTF.F.D
TO BF QUALITY PRODUCTS. IF NOT
COMPLETILY SATISFIED YOU MAY
RETURN Tilt. PROGRAM WITHIN 60
DAYS. A(RED1T OR REPLACLMENT
WILL i)F WILLISCLY CIVUN FOR
A^Y ri;ason.
109
Name
Ad disss
City
. State _
-Zip-
C3 Check a MoneyOrder D VISA D AMEK □ Master Ctiarge
Card No . . E>p. Qmo
Signed - Dale
^^^^^^^^^1 Order your Instant Software today! ^^^^^^^^^|
OuanTiTy
Order No.
Program name
Unll cosi
Total COST
Shipping and handling
St.OO
l^^JL.
^.^^r
^^<4^.»«-^-l^^
TolBl ordei'
Peterborough, N.H. 03458
No. 40 - September 1981
MICRO - The 6502/6809 Journal
25
WhAT'5 MEW?
Consumer Computers announces it's lowest prices ewer.
Apple Add-Ons
Language av^tem A/Pdscai S79
"aye5 MKiroinodcm It , . - 399
hnuacian Appfe-Cac 11 ,.,,-._.. 559
uiOej. uideolerm 80 n/graBlilc5 ... . 269
Z-80 1lcrD5Qft Cara 269
16K r^am CarO PVcrOiOfl 139
ABT numeric Meypad {ow o' new hytyctj 1 10
ftLF i voice rHj5ic Card ......... ?19
Meun^UcE. Speecniinh 2003 lag
Alpha 3vntauri Keyboard f>v^tem .,.,,,... -1599
Corvus 10 HQ Hard Dch , CftLL
Lflzei Luwer Ca^ Plus -..------.. 50
Mlcro-5ciDI5I.Drluc5lA40 8ifl'Q) CALL
55" AID 5enal/Pflrallei Caid AST 189
TdunaeiClocK Phjs CALl
Integer or Applesoft II Firmwaie Card 115
QraplULi Tablel 619
Parallel FFimer Inleifflce Card 155
Mi-5peeo SeihI Intertace Card 155
^marieim 80 Column Video Cafd 299
Mj5ic5y5lem ^ lb w:)h:e^: ... 179
AID t D/A Inlertace ,,.,-. 289
Cloch/Calenoa' Card 225
SuoerlalWr 50-200 259
Rompius ♦ Card 155
Clochrtlalendar ftodule ICC5) 99
A5yrKironou5 ^nai Interface Caid (CC5) 179
We carry all CC5 fiaidware Pledge Call
FREE CATALOG!
Please mail us your name and address.
Solution Software for the Apple 11.
UisicaiclS ,... 1&9
CCA Dala rtanagemenl .-..., 35
DB Msslei 169
WordStar (Apple 80 col uer) 299
Cteshlop Flan II 169
AppJevjiiler 65
ea^VJJiitei 223
Appieplol GO
Pcacliiree Bu^ineSi 1200
Vi5irerm 129
'JibiTrendiVeiPiol 219
DOS roDlhil 65
Daw Janes Porifolio EuaKjalo' .,.,-... IS
Dow Jof*5 hews a Quotes Repo'ter 85
Apple r^ortfan 165
Atari Personal Computer
ATARI 800 16ti
$749
Atari Accessories
4 10 Program RecQider 59
aiOQiihOrive 1149
850 Interlace Module 159
1 6H riam Memorv Module 89
Please call us for an Alan Software LKE
5-100 Cards
S5M ™
Z-flOCPUCO-2 219
104 2 P .25 W) . . . , 189
VO-J 80 » 2a veto 529
VB-5 BO N 43 VIDEO 559
BV-2 VIOeO . . ... 159
PBlPftOMPnOrVWeiEPHOMBOAPlD 159
CCS
280 CPU 2810
64n Dynamic fViM cafd
16t\5iaKHW12Mta
i6KSiaiK FiAnamii.
DCi o«B*v ncfipy one ccMntcr
12 iM Moot
..n/a
..nia
.nta
. .ntt
AssmS
TeMed
279
249
579
129
219
199
229
499
219
269
299
W9
16K
48K
$1025 $1129
Dl5h II Drive ^ e ■] q
w/controller ^* J * "
Dish drive w/out controller
IV* carry tfw Apple III
459
CALL FF^EE!
800-854-6654
In California and outside continental U.5.
(714)698-8088
Warehouse (714) 698-0260
Service (714) 460-6502
TELEX 695000 BETA CCMO
A\/AIL/\BLE how .
The MEC Microcomputer
Please call for more details.
EHidy Sorcerer II
Please call
for
our price.
5-100 u«
ii«ordProc05lniiPBt
DfvelopfYvnt Pac
449
. 179
S9
PfKSO nkro Computer
$599
Ohio Scientific
Challenger
Computer.
4P $549
IPMOOII
599
Printers, Etc.
r t
Epson n«-80
$499
Sileniype w'Apple Interlace ......i. ...... 519
Epson MH-80 Pit , 649
ep5on M^lOO ;.,. 829
Epson M'(.70 , . , . , , , 559
Paper Tiger ID5-145 729
Papef Tiger IDS 160 .-, ^ 1099
Paper Tiger IDS 560 .. 1450
Oume5pnnl5/45 2495
Anaden DP 9500/ Ilia-. Bufler 1 549
C lloh Slaomtet 25 CP5 1649
C Itoti 5t3rujntef 15 CP5 - . . 4- 2249
Centronics 7i7 ;, 699
Watanal>e DigiPloi i 149
Save on V/ideo displays.
AmdeWleede" video 100 12'B8i«J 159
Amdei<iM,tai.n,| IJ^Color 559
fltC12-p5IQreenPhosolief CALt
nCC 12"RQBn|.ResColoi , , CALL
Panasomt 1 5" Color ..,...,.. 419
5anyo9'BaiW .- - 159
Sanol2-B8iW 259
Sanvol2'P51!3reenPho5plier 279
Sanyo 15"Colar 419
Wt emery mucn more Vt*n Uttmd. Ptraie CJll our toil fr*r
orOtf Itn* to r«guefl our complete price "SC.
How to Order
Ordpflng inlormatjon Pnone 0fdef5 usirig yi^A. MA5TCR-
CArO, AMEniCAh EJ1PRE55, DinEf^ 5 CLUB. CARTE
CLArKME, banK wire Irdrisfer, cashier^ oi ceinHed chech,
monev order, or pej^onai checl' [ddow len days lo clear)
Unie55piepflidi<WI'iC35h, pl?a5eadd5% lorsMpping, handl-
ifkg and iniufrance (mlrlirnjm 55.00) Cdllfomia residents ad<1
6% sales [d« LWe accepT CODs. OfMi. InsHHillo'is arnd cor-
ptfaoons please send (or a wrmen quoldtion All equipment
Is subjetl lo pfice change ard auaildbHicy wiihoul noBce AH
equipmeni is new and compleie ijjnri rnanufaclu'er's warran-
IV (usually 90 days) 5rio*room prices mav dlflei 'rcxn mail
o'der prices
Send orders to:
M»i[ Order
8314 Parkway Drive
La Mesa, California 92041
Journal It:
Screen Print Utility
for Atari
t
«
This program describes a
versatile utility for the Atari. It
wiii 'capture' aii screen text I/O,
Including user-program
generated data and system
prompts or responses, and then
'Journal' It on a printer. The
journal will provide the user with
a hard copy of a session's
transactions, for logging or
debugging purposes.
John Elliott
33 Gold Street, Apt. #708
New York. New York 10038
The program described in this article is a
screen print utility for the Atari
400/800, and it will be of interest to
both BASIC and assembly language pro-
graimners. Readers not familiar with
assembly language will want to start
with the section, "Using the Program,"
which describes how to use the program
with BASIC.
My need for a program to print
screen text arose when 1 began using
the Atari Assembler Editor cartridge.
This cartridge contains three separate
programs:
1. The EDITOR program allows you to
create and maintain assembler lan-
guage sotirce files.
2. The ASSEMBLER program converts
the source code to machine language.
3. The DEBUG program provides many
program testing aids, such as single-
stepping through a program and/or
tracing its execution path. DEBUG
wOl also disassemble machine code,
display the contents of memory, etc.
Developirig programs in assembly
language can be difficult and time-
consuming. Therefore a good debug
package is a welcome addition to the
assembly language programmer's sys-
tems software library. I fotmd the Atari
DEBUG program to be very useful, but I
was disappointed to find that output
from the debugger could not be directed
to a printer.
Fortunately, the Atari I/O sub-
system is very flexible, and a straight-
forward 'patch' to the system I/O tables
can be used to reroute data from one
device to another. Specifically, it is not
difficult to 'trap' data directed to the
screen through the screen- editor, and
then redirect it to a printer.
The program in listing I is a logical
extension of this idea. However, instead
of rerouting data directed to the screen,
Figure 1: Normal Screen Editor Dats Flow.
f User \__
I Progran j"
Input
Output
Control
Blot*.
Screen
Editor
Figure 2: Data Flow with Journal Trap Installed.
Ustli}g 1: Screen Journal
oaoa
012D
.PAGE
013D
;+ + + + + * + + + + **4- + + + +***4-+-H. + **+ + +
Ol'iD
:+ ASSEMEiLER ROUTINE TO +
015D
;+ TRAP SCREEN INPUT/OUTPUT +
0160
T+ a JOURNAL IT DN A PRINTER +
0170
;+ JOHN ELLIOTT MAY 'Bl *
oieo
;++ + *++++♦*■*+++ + + + * + *■++ + **■++***
OOOB
0190
WfiFlMST = SOOOS iWARh START FLAG
D31ft
OZflO
HATAGS = »031fl jUEVICE HANDLERS
OZIO
' (Continued)
No. 40 -September 1981
MfCRO - The 6502/6809 Journal
27
the program will duplicate it on a
printer. That is, the data will appear on
both the icreen and the printer. Addi-
tionally, the program will trap data
coming from the screen editor, and copy
that on a printer. The result is a 'journal'
of all screen activity.
Program Description
To understand how the program
works, we need to look at how the Atari
talks to the outside world. The Atari OS
(operating system] includes an I/O sub-
system for commtmicating with the sys-
tem I/O devices, such as disks, cassette
drives, printers, etc. The subsystem is
composed of resident 'handlers,' one per
device. In the normal environment the
user program will communicate with
the handlers via an lOCB (input/output
control block) . Typical data flow is
illustrated in figure I.
in addition to providing a means of
passing parameters, such as data ad-
dresses and request codes, the lOCB
contains pointers to the handler
routines. Since the lOCBs are in RAM
these pointers can be changed to address
custom routines, and that is exactly
what the journal program does. The
handler pointers in the screen editor
lOCB |IOC8 # zero] are changed to pomt
to the I/O trap routines. The result is
that all data coming from, or going to,
the screen through the screen editor (not
the display handler] will be intercepted.
These routines then call the printer
handler to duplicate all screen I/O. The
data flow is illustrated in figure 2.
Besides intercepting screen I/O, the
program performs a certain amount of
control code translation. This is because
the screen editor recognizes sixteen con-
trol codes, most of which are treated as
unprintable characters by the printer,
and will appear as spaces on a printout.
The translation is as follows:
1. the "Clear Screen" code ($7D] is
translated to an EOL (end of line]
character ($9B|;
2. the "Insert Lme" code ($9D] is
translated to an EOL character i$9B|;
3. all codes and characters with a hex-
adecimal value of less than $20 are
ignored.
This is by no means a comprehensive
translation, but I have found it to
be satisfactory for joumaling most
BASIC, Assembler Editor, and DOS
transactions.
Listing 1
(Conlinaedj
0220
IINPUT/OUTPUT CONTROL
BLOCKS
0Z3B
;
0000
0210
lOCEi
x=
tosm
[I/O CONTROL BLOCKS
0310
0250
ICHID
w=
«+l
[HANDLER ID
0311
0260
rCDNO
»=
.tl
[DEVICE NUMBER
0312
0270
rccow
x=
K+l
[COMMAND CODE
0313
0Z8D
ICSTft
t=
**1
iSTHTUS
0311
0290
rCEAL
x=
X4-1
ieUFFER AODRESS LSB
0315
0300
ICBAH
■;=
«+-l
[EJUFFER ADORESS MSB
0316
0310
ICPIJT
*=
K + 2
[PUT ROUTINE AODRESS
0318
0320
ICBLL
K"
•f+l
jeUFFER LENGTH LSB
D319
0330
ICELH
h;?
jl+1
(EUFFER LENGTH MSB
031A
0310
ICAXl
M =
«+l
[AUX CONTROL BYTE 1
0316
Q350
0360
ICAX2
■f=
m-1
[AUX CONTROL BYTE 2
D370
!ENyiRONMENT flODRESSES/EOfJATES |
0380
BFFA
0390
CSTART
=
SEFFA
[CARTRIDGE START
7[)
OIOO
CLEAR
=
$70
[CLEAR SCFtEEN CODE
0020
0110
■iF'ACE
^
«2D
[FIRST PRINTABLE CHAR
9C
0120
DELETE
=
*9C
[OELETE-LINF CODE
0D9B
0130
0110
EDL
=
t9e
[END OF LINE CODE
031C
0150
0160
.
«-
*E100
[START OF VECTOR TfiE;LES
0170
JEDITOR UECTOR TABLE
0100
/
E1U0
O190
EOITRV
=
K
(■;e:3' VECTOR TABLE
riDO
0500
EDOF'EN
*=
x+2
[OPEN VECTOR
E102
0510
EDCLDS
*=
*+2
[CLOSE VECTOR
E101
O520
EDGETEi
x=.
«+2
[GFTCHAR UECTOR
E106
0530
EDPIJTB
x=
x+2
(PUTCHAR VECTOR
EIOB
0510
EDSTflT
*■=
*+2
[STATUS VECTOR
[ilOA
0550
EDSPEC
*r?
*+2
[SPECIAL VECTOR
noc
0560
HDIMTT
*=
«+3
[INIIIALIZAIION
rioF
0570
058O
r
K =
»n-l
[BPAFiE
e:iio
0590
KCRENU
x=
•+16
(S: VECTOR TABLE
EtZO
0600
0610
KEYBDU
f
*r=
«*16
(K[VECTOR TABLE
D6Z0
JPRINTER VECTOR TABLE
0630
J
E130
O&'iB
PIlTNTy
=
X
■,':Pfi VF-CTOR TABLE
f:i:31i
06^0
PRO PEN
*■=
x+2
[OPEN VECTOfi;
[E13Z
066
PRCL08
*=
x+2
[CLOSE VECTOR
Ei:ii
06/0
PRGE.JB
«=■
x+2
[GETCHAR VECTOR
E13fi
06SO
PRPIJTF!
*=
x+2
[PUTCHAR VECTOR
E138
0690
fRST.-ir
*=
x+2
[STATUS VECTOR
E13A
0700
F'RSPEi;
*=
x+2
[SPECIAL VECTOR
E13C
0710
PRINIT
*=
x+3
[INITIALIZATION
e:i3F
072O
M =
x + 1
[SPARE
Fiin
0730
.PAGE
0600
0710
BEGIN
=
«0600
[PROGRAM ORIGIN
E11D
07SO
076
*^
BEGIN
■
0770
[COPY
tE[:-
wectof; table |
07EID
OifiOO
Aoor
0790
L[)Y
#15
[LENGTH GF VECIOR TABLE
0602
OBOO
CDPVEC
=
X
(COPY CEiy VECTOR TABLE
0602
E900E1
03i.ll
LDA
eoitru.y
0605
99B306
0820
STfl
HAUECii.Y
06DS
sn
nrs30
DEY
0609
inF'7
0U1O
0350
EPL
COPUEC
[LOUP 'TIL ALL COPIED
0B6O
[CHANGE CE.
> IWNDLER
VECTOR
0370
; TO POINT
TO OUR TABLE 1
980
06DB
0983
0890
LOA
*HAyECSg»FF 1
D6DD
8OZ103
0900
STA
HfiTABS+-7
; ;e[> vector lsb
0610
fl906
0710
LDA
*HftVeCS/256 1
0612
SD2203
0920
0930
fiTA
HftTABS+B
[■r:E[J VECTOR MSB
0910
[POINT
TO OUR PUTCHAR
ROUTINE
0950
0615
A91A
0960
LOA
♦OUTPUT-ISSPF 1
0617
308906
097U
STA
HAPUTB
[HANDLER TABLE.. .
06iCi
801603
09BO
STA
ICPUT
[ ...AND lOCB
061L)
A906
0990
LOA
*aUTPUT-l/256 I
06ir
aOBA06
1000
STA
HAPUT6+1
0622
8D1703
1010
1020
STA
ICPUT+1
1030
[POINT
TO OUR GETCHAR
ROUTINE
1010
IContinued)
23
MICRO - The 6502/6809 Journal
No. 40 - September 1981
«
Listing 1 (Continued)
0425
fl933
1050
LDA
*IHPUT-lg»FF 1
9627
SO870£
1060
STA
HAGETE
{HANDLER TABLE ONLY
062(1
^906
1070
LOA
*IMPUT-l/256 1
D62C
8D88D6
1080
1090
STA
HAGETE+l
1100
jyECTQRS ESTABLISHED
~ NON EXIT
lllB
(162F
8508
1120
STA
UARMST
ISET HARMSTART FLAG
0631
SCFflEiF
1130
1110
IISO
JHP
(CSTART>
[CARTRIDGE START
1160
! MIRROR SCREEN INPUT
TO PRINTER
1170
063')
1180
INPUT
-
X
0631
009286
1190
STA
SAUEA
ISAVE ACCJMULATOR
0637
2B3F06
12!ia
JSfi
EGET
;go get screen input
063(1
206006
121B
JSR
PPUT
[JOURNAL INPUT ON PRINTER
D63D
[)Q17
122
123Q
E^iNE
EXIT
lEACK TO CALLER
1210
1250
126U
!G0 RETT SCREEN INPUT
e63r
EGET
„
X
063r
n[)05E1
I27D
LDA
EDGEietl
:hi byte; first
06^12
1£l
12B0
PHA
0613
ftf)04E1
129
LDA
EDCETE
!L0 E^YTE LAST
0616
IB
13011
F'HA
061?
flD9206
J 310
LOA
EfiVEA
06in
60
132
FiTS
;G0 get THE SCREEN IMPUT
[)64Ei
1330
.PAGE
1310
1350
JMlFfROR SCREEN OUTPUT
TC P)^INTER
1360
061P
1370
OUTPUT =
X
64ES
206006
13Q0
JSR
PPUT
!PUT CHARACTER TQ !_P!>
1100
JPUT CHAR TCI tEin
1110
»
6tE;
1120
EPUT
^
K
ailET
AD07E:'i
1130
LDA
EDPUT&fl
J HI BYTE FIRST
06S1
13
1110
PHA
06S2
rtD0 6E1
llfiO
LDA
EDPUTP
;lO byte LAST
065S
113
116
PHA
0654
1170
EXIT
=
X
[COMMON EXIT POINT
f)6^6
flD9206
HBO
LOA
SAVEA
JRESTDPE ACCUMULATOR
nfts'y
fiF9306
119
LDX
EAUEX
IREETCIRE REGISTER X
<i6r,c
flC9106
1500
Lor
EAiJEY
[RESTORE RLGISTI;R V
65F
60
ISIO
1520
f
RTS
[PUT CHAR TO SCRiTEN/EXn
1530
fPUT CHAR TQ iPrj
0660
1550
PPUT
=!
V
0660
ttD<;'206
156
STA
SAULA
[SAVE ACCUMULATOR
0663
3E9306
157
STX
5Mb.X
[SAVE REGISTFIfi X
0666
Bi;9106
1580
STY
SAWEV
[SAVE RILGISTER Y
0669
C920
1^90
CMP
♦SPACE
[PRINTABLE CHAR?
66EJ
9015
16(10
ecc
PCALL
iNO. . .IGNOF(E IT
1)660
AD37Eri
1610
LDA
PRPUTB-< 1
[HI ESYTE FIRST
DS70
18
1620
PHA
067]
AD36F1
1630
LDA
PRPUTE:
[LO BYTE SECOND
ti671
18
1610
PHA
0675
AD9206
1650
LD(5
SAWEA
[PICKUP CNARACrtlR...
0678
C97D
1660
CMP
*cli-:ar
[CLEAR SCREEN?
067fi
F001
1670
BED
PSUU
[YES. ..SUBSTITUTE EOL
067C
r:99C
1680
CMP
*de:llte
[deletf; line?
067E
DOO?
1690
PNE
PCALL
[NO. . .PKINT IT
0680
17
PSUB
X
[SUBSTITUTE EOL
06Sn
rt99C
1710
LOA
*FGL
[SUBSTITUTE EOL
06R2
1720
PCALL
X
0602
60
1730
FITS
[.. .ftNU PRINT IT
1750
JMODTIIED <E:-i yECTOf!
lAELE
176D
■
0633
1771)
HAMECS
=
X
[HANDLER VECTORS
0603
1780
^AOPFN
K=.
• ■(■2
{OPEN VECTQR
(16Ei5
1790
lACLOB
K =
»+2
{CLOSE VECTOR
(16FJ7
ISOQ
lAGETE
X =
K+2
[GETCHAR VECTOR
689
lein
HAPlJTEi
* =
x+Z
[PUTCHAR kJECTDR
068B
1B20
1AETAT
x=
*i 2
[STATUS VECTOR
068D
1830
1ASPEC
*^
X 1 7
[SPECIAL VECTOR
06E)F
1810
^(1INIT
Jl=r
x+3
[INITIALIZATION
lEi60
{REGISTER SAWE AREAS
1870
■
0692
1880
lAWEA
X=:
x+1
[ACCOM SAVE AREA
0693
1890
=AVEX
*=i
x+1
[REG X SAVE AREA
0691
1900 SAyEY
* =
x*l
[REG Y SAVE AREA
0695
1910
.END
Program EoTuonment
The program is designed to work
equally well with BASIC or the
Assembler Editor cartridge, with or
without DOS, It does not conflict with
any of the BASIC or Editor functions,
nor does it impose any limitations on
application programs. It does not use
any of the Ic3CBs (other than the screen
editor's), therefore no program changes
will be required before it can be used.
Other than the system I/O ubles,
the program's use of RAM is Kmited ex-
clusively to page 6; no page zero loca-
tions are used. Page 6 is n<K used by
BASIC or any other Atari system soft-
ware, and so is available foi our use.
Once loaded into RAM, the program
will remain intact until removed by the
user. None of the system programs will
encroach upon it. Conversely, the pro-
gram does not encroach upon the RAM
allocated to the system programs.
Therefore it does not have an impact on
memory availability, and will run on
the minimum 8K system configuration.
The program is compatible with all
the standard Atari software. However, it
uses the in-ROM system vectors to call
the printer handler. If you have installed
a non-resident printer handler, you will
need to modify the journal program to
conform to the interfacing conventions
of your handler.
So far as hardware is concerned,
the program will work with either the
Atari 820 or 825 printer. It should
also work with the Atari 822 Thermal
Printer, although I have not been able to
verify this.
Using the Program
The program is an assembly
language routine, written to reside on
page 6 of RAM. Those of you who have
the Assembler should assemble the pro-
gram shown in listing 1. For those of
you who do not have the Assembler, I
include a BASIC program [listing 2]
which will POKE the machine code into
RAM. (Listing 3 shows a sample RUN of
this program, } If you use the BASIC pro-
gram, be sure that you enter the DATA
statements exactly as shown, otherwise
the system might crash when you use
the journal program.
When you have loaded the program
into RAM, you should execute it
whenever you wish to initiate joumal-
ing. Before doing so, be sure that the
printer is cotmected and powered on. If
you are using BASIC, execute the pro-
No. 40 - September 1981
MICRO -The 6502/6809 Journal
29
Listing 2: BASIC program to sat up Screen Joumai Program.
10
11
12
i;)
15
16
17
lEi
19
20
22
21
26
28
30
35
36
37
33
39
to
15
50
+ + + . H.,t, + + + + + + 4-4- + + + + + + + + + + + + + + + +
+
BASIC PROGRAM TO SETUP +
MACHINE LANGUAGE ROUTINE
THAT WILL
TRAP SCREEN INPUT / OUTPUT
& JOURNAL IT TO A PRINTER
JOHN ELLIOTT MAY '81
+ + + + + + + + +++ + + + + + 4- + + + + + + + + + + + + +
AO
65
70
75
80
81
82
83
81
85
90
95 '
100
101
102
103
101
ins
iin
115
120
125
130
135
110
115
150
155
160
165
170
175
18
185
190
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
DIM HEX4(3)
MLPR0G=1536:REM page 6 ADDRESS
GRAPHICS
POKE 752,1:REM CURSOR OFF
? :? "LOADING JOURNAL"!?
REM
REM
REM
REM
REM
FOR ADDR-MLPROG TO MLPROG-H021
READ HEX*:SOUNO , ADDR-MLPROG , 1 , 1
IF HEXt-"END" THEN POP :GOTO 80
HI-ASCCHEX*(1,1)>-18
IF HI>9 THEN HI=HI-7
L0=ASC(HEX*(2,2) )-18
IF L0>9 THEN L0=L0-7
POKE ADDR,HI*16+L0:NEXT ADDR
RETM
+ ++++. ), + + + + + ++.H. + + + + + + ++ + ++ + + + +
+ DISPLAY INSTRUCTIONS +
4. 4- + .)..). + + + + + + . f + + + + + 4- + + + + 4- + +f + + + +
4. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ SETUP MACHINE LANGUAGE PGM +
•I ++++++++ ++++++++++++ ■*■++++++++
REM
REM
REM
REM
? "journal loaded"!? tpdke 752,0
? "to initiate journalling type !"
? :? "X=usr<"!mlprog;")"
REM
FtEM ++++ + ■»■+ ++++++++++++++++■•■++ +++
REM + HEXADECIMAL M/L PROGRAM +
RfTj^l 4.4.4. + 4. + + + + + + + +. + + + + + + + + + + + + + -f + +
REM
DATA AO,0FrB9,0O,E1»99,83,06
DATA 88, 10, F7,A9, 83, 80,21,03
DATA A9,06.8D,22,03,A9,1A
DATA 8D,89,06,8D,16,03,A9,06
DATA 8D,8A,06,8D,17,03,A9,33
DATA 8D,87,06,A9,06,8D,88,06
DATA 85 , 8 , 6C , FA , BF , 8D , 92 , 06
DATA 20, 3F, 06, 20, 60, 06, DO, 17
DATA AD, 05, El, 18, AD, 01, El, 18
DATA AD, 92, 06, 60, 20, 60, 06
DATA AD, 07, El, 18, AD, 06, El, 18
DATA AD, 92, 06, AE, 93, 06
DATA AC, 91, 06, 60, 8D, 92, 06
DATA 8E,93,06,8C,91,06,C9,20
DATA 90, 15, AD, 37, El, IS, AD, 36, El
DATA 18,AD,92,06,C9,7D,FO,01
DATA C9,9C,D0,02tA9,9B,60
DATA END
gram, using the command X = USR
(15361, as shown in listing 3. If you are
using the Assembler Editor cartridge,
use the DEBUGGER'S GO (execute pro-
gram) coirunand, as shown in listing 4.
Those of you who have DOS may use
the RUN AT ADDRESS option to ex-
ecute the program, as shown in listing 5.
Note that both the DEBUGGER and
DOS expect the address to be given in
hexadecimal, whereas BASIC expects
the address in decimal.
To terminate joumaling, press the
SYSTEM RESET button on the console.
The program will remain intact in RAM,
and can be re-executed whenever you
wish to re-initiate joumaling. Turning
the printer power off will, of course,
terminate joumaling. However, this is
not recommended, since the trap pro-
gram will continue to try to jomnal
screen I/O, and wil! succeed only in
wasting time.
These operating instructions are in-
tended only as guidelines. There are
many other ways the program can be in-
voked and you should use the procedure
which best suits your ov^ti operating
environment.
Conclusion
I believe you will find that the more
you use this program, the more uses you
will find for it. In addition to providing a
joumai of screen transactions, the pro-
gram can be used to provide printed out-
put from in-ROM programs which you
cannot change, as in the case of the
DEBUG program. Furthermore, you
need never again go through your own
programs, changing all the PRINT
statements to LPRINT statements when
you want the output to go to a printer.
Another interesting feature is that you
can commimicate with your Atari using
Listing 3: Sample run of program In
llsling 2.
READY
RUN
LOADING JOURNAL
JOURNAL LOADED
TO INITIATE JOURNALLING
TYPE :
X^USR<1536)
READY
%
the printer instead of the TV screen:
turn off the TV and talk to the computer
through the printer. Or, you can treat
your Atari as an intelligent typewriter,
using the screen editing features to cor-
rect errors.
In short, there are many possible ap-
plications for this program, and I'm sure
you will find even more uses than are
listed here. I will be pleased to hear from
those of you who do.
Listing 4: Example of using the debug-
ger to Initiate Journalllng.
EDIT
BUG
DEBUG
G600
EDIT
Listing 5: Example ol using DOS to in-
itiate journalllng.
REAOy
DOS
UISK OPERATING SYSTEM
CClpyftlGHT 1979 ATARI
a. [)1SH DIRECTOBV
B. FdJN CARTRIDGE
C. COPY FILE
D. DELETE FILE(S)
E. RENAME FILE
F. LOCK FILE
G. UNLOCK FILE
H. WRITE DOS FILE
I. FORMAT DISK
J. DUPLICATE DISK
\:. BINARY SAVE
L. EiINARY LOAD
M. RUN AT ADDRESS
N. DEFINE DEVICE
Q. DUPLICATE FILE
SELECT ITEM
M
RUN FROM WHAT ADDRESS?
600
READY
9/2t/79
JtSlSiSW.-.-
. ..-j>H^'
■.■■■■:-*?J«jK}S.-=i
SOFTWARE AUTHORS!
for Apple, Atari, TRS-80, NEC, Hitachi
Brttderbund Software Is looking for new auttiois to join its
International team of pro gram mers. If you tiave a product foi
the micro market, let us show you the advantages of working
'With OUT team of design, production and distribution
specialists. '—■i-~.t^t^;-^-'
Call or write for our free Authors Kit today or send us a
machine readable copy of your work for pronipt review under
strictest confidence. w;t^ vav
' -■-•■-i
derbund SoPtuuar
John Elliott is currently a Systems
Consultant for On-Line Software
International. He has been in the data
processing field for over twelve years,
specializing in implementing
telecommunications software on large
compuier systems. He has served as a
consultant in various locations in the
USA, Europe and the Middle East. He
finds that tinkering with his Atari provides
an interesting contrast to his work on
. mainframes ■
, #2 Vista Wood Way, San Rafael, CA 94901
CBM/PET? SEE SKYLES ... CBM/PET?
**Look how fast I create these
great graphic displays on my
PET with the new PicChip...
it's like home movies."
PicChip, the new ROM ttiat took Europe by storm, available
only from Skyles Electric Works in the U.S. and Canada.
PicChip, a ROM exicnsion of Ihe BASIC version [IJ. BAS[C 4.0 or BASIC 8032 inierpreler
ihai offers over 40 cummands thai allow you lo crealc programs wiih dynamic graphics
displays: plots, bar graphs, ptclures; and roUing^ scrolling, shifling and inverting. All in-
sranEly and easily added lo your BASIC program.
The addresi for the 2000/3000 (which would require PicChip module PC2), for the 4000
IPC4), and for the SOOO(PCa) is SAOOO... unless you have a Mikro, WordPro III or IV,
or Jinsam, which occupy thai same address. Jn those ca.ses. you W'ill need the PicChip on
an interface board that would reside in address BSOO... For the 2000/3000 series (PCBZ),
above the Toolkit. For ihe 4000 (PCA4) and 8000 (PCA8). the Mikro or WoodPro would
be ^wicchable manually using the Skyles Sockel-2-ME.
Skyles guarantees your salisfuclion: if you are not absolutely happy with your ne^v
PicChip return it to us within ten day:, for an immcdiale, full refund.
PicChip rrum Skjles Eleclric Works (Please indicate PC2, PC4, PC8| 560.00
Complcte*ilh Interface board (Please Indicate PCB2.PCA4.PCAa),.,. 80.00
Shipping and Handling (USA/Canada) S2.50 (Europe/Asia) SIO.OO
California residents must add 6%/6'/i % sales lax. as required.
Skyies Electric Works
231E South Whisman Road
Mountain View. Callfomla 94041
(415) 96S-173S
Vlsa/Maslercard ardent: call lollfrce |
(800) 127-9998 (except California).
California orders: please call (415)
965-1735.
MOW-
/lAiaO ■■• S3nA>IS 33S 6l3d/IAiaO"" w
No. 40 - Seplember 1981
MICRO - The 6502/6809 Journal
31
X
On The
Built-in
Display
/CBM 20aO/300a/-4DOO Series
ES75.aO *
Select either SO x S5 or 40 x SB display format
From the keyboard or program
Features the same memory map and subroutines fronn the Basic ROMs [specify
which version of Basic when ordering] * * , for standard programming. You also
gain the use of iOSS extra mennory locations in the AO coiumn mode, or 4"7
extra locations in the SD column mode. [These locations are available only to
machine language programs, or peek S poke from Basic).
Displays the full, original character set, including graphics characters in either
mode.
All utility software, firmware, like Toolkit'", Dos Support [Wedge], Extra-mon. etc.,
is compatible in both modes of operation.
The complete enhancement consists of: 1 dual 24-pin socket [one socket for the
■40 column screen editor, and one for the BO column screen editor], and a circuit
board that replaces the existing screen RAM. Each circuit board is registered
to the original oxA/ner. There is also an SO column reference ROM that plugs in
one of the expansion sockets [specify the address when ordering]. An option
board is available [SeS.OO] that allows the ROM to be used with any other 2K
ROM, in any of the expansion sockets.
Available from your local dealer or:
EXeCOM COPP.
1901 Polaris Ave.
Racine. \A/I 53-40-4
Ph. 41 4-632-1 004
* Plus appropriate installation charges. This requires some circuit modification,
[available from the factory for S7S.OO plus shipping]
• * If power-on message = ### COMMODORE BASIC ### you have 3.D Basic.
[Available only for Basic 3.G S Basic 4.D at the present].
PET^*^S CBM are trademarks of Commodore Business Machines.
We will ship via Master Charge, VISA, C.O.O., or pre-paid.
Toolkit'^is a trademark of Palo Alto iC's, Inc.
Instaliation may void your Commodore SO day warr.
The Execorrf^board is guaranteed for 1 year.
32
MICRO - The 6502/6809 Journal
No. 40 - September 1981
t
iMCQO
PET Vet
By Loren Wright
2114 RAM Adaptor
If you have one of the old PETs with
6550 RAM chips, you probably have had
one or more of them fail by now. You
probably had to pay a high price for the
replacement, if, in fact, you were able to
find one. Optimized Data Systems (P.O.
Box 595, PiacentU, CA 92670] offers an
inexpensive board that plugs into a pair
of empty 6550 sockets and allows
substitution of up to half of the 6550s
with the considerably more common
and less expensive 2114 RAM chips.
The board is available in a number of
versions, from a bare board |$8.95] to an
assembled version with one 2114 and
two sockets |$24.95). The board is con-
veniently laid out and works well.
PET Power Problems
Owners of older PETs may have
experienced various forms of flakiness,
particularly when additional devices
draw from the PET's power supplies.
The universal advice has been simply to
avoid placing additional loads on the
PET supplies. The fault, however, is not
in the capacity of the power supplies,
but rather in the poor design of the
power connection to the main logic
board. The board has a male cotmector
consisting of round pins, while the
female cotmector has flat spring con-
tacts — not a very good connection!
Under normal operation, the whole
thing heats up and may eventually cause
loss of contact and a crash. With an ad-
ditional draw on the supply, the critical
point is reached more quickly. Jim Yost
of Somerville, Massachusetts, has come
up with a simple and cheap solution:
Identify the two outside wires
[usually brown) on the female power
connector. These lead to two
separate terminals of the power
transformer. Between these two
transformer terminals and the posi-
tive ( + ) terminal of the large elec-
trolytic capacitor cormect two rec-
tifier diodes (3A, lOOV PIV). The
diode positive terminals should lead
to the capacitor positive terminal.
This bypasses the power surges to
the capacitor. See figure I for details.
HEAR OF PET
ADDITIONAL
DIODES
LARGE
ELECTROLYTIC
CAPACITOR
OUTSIDE
WIRES
POWER
CONNECTOR
TO PET
MAIN LOGIC BOARD
Figure 1: Inslallatton of diodes (not to scale — not all wires shown).
Old PETs Live On!
Duncan Moyer of Auburn, Califor-
nia, points out that while a SYS 64824
on the old PET does a system reset, it
fails to reset the Auxilliary Control
Register to 0. To get the cassette to work
properly, you must also POKE 59467,0,
I have received a number of letters in
support of the old PET, and I vfill treat it
as a respected member of the Cormno-
dore family.
More on Command-O
During the course of writing an 8032
program to process the questioimaires
included in the July MICRO, I made
good use of Command-O's SCROLL and
"softkey" features. The "softkey"
saved me from typing lots of repetitive
lines. It's nice to be able to enter with a
single keystroke "X= :Y =
:GOSUB5000" (followed by the appro-
priate number of back cursors to wind
up right after the fust ' = ' ] .
In my review of BASIC upgrades
(36:62). I casually mentioned that the
FIND command of Command-O had
been improved. It allows specification of
a range of lines in which the search will
occur. Each occurrence causes the line
found to be listed with the begirming of
the search string in reverse field. This
means that if the same string appears
three times in the same line, then that
line will be listed three times.
Be careful when you make correc-
tions to lines listed by the FIND com-
mand, though. If the found string is
within quotes, then the first character
will stay reversed. This is not a prob-
lem, unless you happen to hit one of the
special 8032 control characters. It took
me about 20 minutes one day to dis-
cover an embedded reverse 'o' as the
cause of an unwanted WINDOW
cormnand!
Typesetting for the Common Man?
Type Share (8315 Firestone Blvd.,
Downey, CA 90241] has announced an
inexpensive typesetting input system
based on the Commodore VIC-20. The
armounced price is less than $500 in-
cluding the VIC and software, but does
not include the video display. Users
record the input text on cassette for
transfer to a larger computer for further
editing/ merging, or the cassette can be
sent directly to one of the Type Share
centers. The V!C-based system makes
typesetting available to a number of
small volume users, who could not other-
wise afford to have typesetting done.
JUCRO
No, 40 - September 1981
MICRO - The 6502/6809 Journal
33
we beat the price...
800™ $779
WITH ONE YEAR EXTENDED WARRANTY
A
ATARI
Computers
for people."
/TMlBlMli;
875 DUAL
DISK DRIVE
$1199
ATARi SOFTWARE
CX401 General Accounlirg 1399.00
CX402 Accounts Receivable 1399 00
CX403 Inuenloiy Corlrol ...S399,0O
CXWJ Word Processoi ., S1 19.00
CXJ05 PILOT -.,, $68.00
CX413 MICROSOFT BASIC $68.00
CXllOl Ini'ilalion lo Programming 1 $17,00
CX4102 Kingdom 113.00
CX4103 Slalislics $1'.00
CX41D4 Mailing Lisl S17.00
CX4105 BlacKiBch $13,00
C;<ai06 inuiiaiion lo Programmmfl 2 $20.00
CXJ107 BJorhylhim $13,00
CXJ10B Hangman S13.00
CXJ109Grapti It $17,00
CXill 10 Touch Typing $20,00
CX4111 Space Invaders $17.00
CX41l2Slales S Capitals $13.00
CX411J European Countries a Capitals $13 00
CX4115 Mortgage 8 Loan Analysis $13.00
CX4118 Personal Fitness Pfog $59 00
CX4117 Invilalion to Progiammlng 3 SZOOD
CXJ IIS Conversational Ftencti $46 00
C/4 119 Conversational German $45,00
0X4120 Con^ersalioiialSBsnisfi. $45.00
CX412I Energy Czar $13.00
CX4125 Coniiersalional Italian $45 00
CX600I U.S. History $23 00
CX60C2 U S Governmenl. $33.00
CX6003 Supervisory Skills $23.00
CX60O4 Woria Hislory $33 00
CX60O5 Basic Sociology $23.00
CX6606 Counseling Proced. $23 00
CX6607 Prinoipal of Acl $23.00
CX6608 Pnysics $23.00
CX6609 Great Classics $23 00
CX6010 Business Comm $23.00
CX6011 Basic Psychology ..$23 00
CX6012 SMeclive Willing $23 00
CX6014 Principals of Econ. , . $23 00
CX60I6 SBSIIing $23.00
CX6016 Basic Electricity , . . , $23.00
CX6017 Basic Algelira $23.00
0X8106 Bond Analysis ■ $20.00
CXB107 SlocK Analysis $20.00
OXatoa Slock Charting $20.00
CX1.4001 Education Syslem lilaster $21.00
CXL4002 Basic Computing Language $40.00
CXL4O03 Assembler EOilor , , $48,00
CXL4004 BasketQall $24.00
CXL4005 Video Easel $24.00
CXL4008 Super Breakout $30 00
CXL4007 Music Composer $45.00
CXL4009 Ctiess $30 00
CXL4010 3.DTic-Tac.Tow .. $24.00
CXUOIt Slai Raidsrs $32.00
CXLM12 Missle Command $32.00
CXL4013 ABl8ri)idi $32.00
CXL4015 TeleLInk $20.00
Compuhome $74 95
Visicalc $149 00
Letter Perfect (Wonj Processor) $i 19.00
Sourca $89 00
Atarl^ Peripherals:
ano 18K $329.00
410 Recorder $59.00
610 Disk Drive $449 00
815 Disk Dnve $1199.00
B22 Printer $359 OO
825 Printer $629.00
830 Modem $159.00
860 IntBrface , $13900
Atari* Accessories
New DOS 2 System $2100
CX70 Light Pen S64.00
CX30 Paddle $18 00
CX40 Joy stick $181X1
CXa5318KRAM 589.00
Mic'ole^ 16K RAM $75,00
MICfOlek321^ RAM $189.00
commodore
CBM8032 $1099
4015 $?99.00
4032 .,.$999.99
8095 $1796.00
CBM4022 Primer $629.00
Tally 8024 $1699 00
CBM C2N Casselle Dnve $69 00
CBM4040 Dual Disk Drive $999 00
CBM8050 Dual Disk Drive ..S1349 0Q
VIC 20
$259
CBM Software
WordProSPIus $199.00
WordPro4PIU5 $299.00
Commodore Tax Package $399 00
Visicalc $149 00
EBS Accts. Rec./lnvenlory Interactivs SysL . . . $595.00
BPI General Ledger $329 00
OZZ intormalion System $329.00
Do* Jones Portfolio $129 00
Pascal $239.00
Legal Time Accouniirg $449 00
World Craft 80 $289 00
Word Check $180 00
Creale-ABase $180.00
Power $8900
Socket.2.Me $20 00
jinsam - Call
Vic-TV Modual $19.00
Vic Cassette $69,00
Vic Disk Drive $ Call
Vic 6 Pack program $44.00
Disks
CX8100 Blank Disk (5) $22.00
Sycom Blank Oisk (10) $29.00
Maxell Blank Disk (101 $3500
Ma. ell Blank Disk (101 $48.00
Printers
Epson MX. 70
Epson MX -80
Epson MXBO FT /■ Call lor prices
DiaOlo630
Nee 5530. .. . $2495.00
TEC 1500 Starw rile r 26cps $1495.00
TEC 1500 Slar»riler45cps $1995.00
}
No Risk, No Deposit On Phone Orders, COD or Credit Card,
Shipped Same Day You Call * «.
" on all in stock units
IN PA. CALL: 717-323-7921
(800) 233-8950
COMPUTER MAILORDER
501 E. 3RD ST., WILLIAMSPORT, PA 17701
To Order:
PhDne orders inviled (800 number is lor order desK
onlyf. Oi sernl check or money order and receive
(ree shippirig. Pennsylvania resiflenls gdd 6%
sales lax. Add J% 'or Visa or M C. Eqjipmem
js subjeol lo price change gnd availability wilfioul
nolice, Pleaae call between ll AM & 5 PM.
34
MICRO - The 6502/6S09 Journal
No.40-Seplember198l
L
•
Did you know that the Molotola 68000, nol Ihe 6809, is the
logical successor to Ihe 6502?
Did you l<now Ihat you can attach a 68000 processor board
to your Apple II or PET/CBM foi about $600? That such a
board is available from us?
Did you l<now that a four-function floating point package,
with a logarithm routine, is available in microsotl Apple
ll/PET format? That the log routine runs over 10 times (aster
than in the 6502? That you can buy a copy of this package
from us in source form tor only $10 plus 50 cents postage?
Did you know that your Apple II or PET/CBM would make a
very nice I/O processor for a 68000 CPU?
A newsletter covering simple 68000 systems and attached
processors is available from us for $15/6 issues. Send $2,50
for just the first issue.
For more information, send an S.A.S.E, to:
DTACK GROUNDED
Dept. 101
1415 E. McFaddenSt. F
Santa Ana, California 92705
%
*
This is an attache style case for carrying and protecting a
complete ATARI computer system. It will hold the 800 or 400
computer, disk drive, program recorder and a small printer
in a variety of combinations. Constructed ol Ihe highest
quality luggage material. Will accommodate equipment in a
fully operational configuration along with manuals, working
papers and disks. Never a need to remove equipment from
case. Simply remove lid, connect power and operate,
AT 301 Computer case $1 09.00
AP 105 12" Monitor & accessory case 99,00
P 402 825 Printer case 89,00
Cases also available for Apple. Radio Shack and peripherals.
Ask at your local computer store or order directly.
compurer case companv
S650 IMDIAN MOUND CT COLUMBUS OHIO «21^ (614) BflB-a464
\^vr I
SPECIAL-This month only!!
(Please mention this ad when ordering.)
EHS SOFTWARE
- PET fiflAE . S169.95
IRpad Ihe raw revieivs about this Disk-based Macro Assembler
Text g(j|tor,l
Graphics DraiAiing Compiler milh pucghsse ot MAE, , , S 10.00
- APPLE Bnd ATARI tilAE $169.95
Similer fKacures es PET MAE, {Free — either 10 diskettes or
Mini-Ftex diskette file cas^.l
- PET Macro Assembler /Editor and Graphics Drawirig Compiler,
Both for S 55,00
- Cassette Rabbit far 3,0 Ram PET Computer!, Highipsed caisalle
J/0, Load and ^ve an &K program from ynur caEselte deck in
approximately -30 seconds versus almost 3 minutes without
Rabbil. Specify memory, ,.,,.,.,,.,..,,., $ 19.9B
Rom version of Rabbit for 3.0. 4J)or S032 $ 49,95
- TRAP 65 - Use this device 1o intercept unimplimenled opcodes
and even expand the 6502's instruction set. For practically any
6502 microcomputer. Super Special 3112.50
- EPROM Board lor ATARI Computers. Plugs into slot A or B anO
can accept 2716, 2516, 2532, 2732 type EPROME. Hall the
price thai ATARI gels lor theirs $ 19.95
Send mailing label and t^o ISrf stamps for tree EHS Gazette,
Write tor our catalog and spec sheets on our products.
EHS HARDWARE
PEDISK fbvCGRSI disk drive $550,00
For COMMODOHE computers. The rtiost cost effective way to
add a disk, MAE will be available for PEDISK Soon,
VIC Color Computer $265.00
ATARI 400 16K memory $345,00
ATARI SOO 16K memory $779,00
EPROM programmer for PET Computers
IThe Brarrding Iron] $ 75,00
Includes Hardware and Software for programming 27 16 and 2532
EPROMS,
2532 EPROM $ 18.00
4K byte EPROM. Use them in PET/APPLE/ATARI/SYM
Starwriler 25 CPS printer with tractnrs. CBM - £1690,00.
APPLE = S1645 .00 (parallel), $1700,00 (RS232)
Universal Data System Modem direct connect 300 baud ORG/
ANS $169,00
with auto answer £199,00
1 20D baud $259,00
ACCESSORIES
Syncon^ or Memo ten
5-1/4" diskelles. , , .
10 for $30.00
Mini -Flex diskette file case
holds 60 - 5-1 f1" diskettes $24.95
VISA'
Call for prices on Zeiiilfi and Supe-r Brain Compulers and v^hatevei else you need.
Eastern House Software
323S Linila Drive
Wlnslon-Salem. N.C. 27106 U,S.A,
(Please add sufficient Funds for Postage.)
PHONE ORDERS
(919) 924-2889
4919) 748-8446
No. 40 -September 1981
MICRO - The 6502/6809 Journal
^
inc
BOX 120
ALLAMUCHY, N.J. 07820
201-362-6574
HUDSON DIGITAL ELECTRONICS INC
THE TASK* MASTERS
HDE supports the *TIM, AIM, SYM and KIM (TASK) with a growing line of computer programs and
peripheral components. All HDE component boards are state-of-the-art AVi" x ev?", with on board
regulation of all required voltages, fully compatible with the KIM-4 bus.
OMNIDISK 65/8 and 65/5
Single and dual drive 8" and S'A" disk systems.
Complete, ready to plug in, bootstrap and run.
Include HDE's proprietary operating system,
FODS (File Oriented Disk System).
DM816-M8A
An 8K static RAM board tested for a minimum of
100 hours and warranted for a full 6 months.
DM816-UB1
A prototyping card with on-board 5V regulator
and address selection. You add the application.
DM81 6-P8
A 4/8K EPROM card for 2708 or 2716 circuits.
On board regulation of all required voltages.
Supplied without EPROMS.
DM816-CC15
A 15 position motherboard mounted in a 19"
RETMA standard card cage, with power supply.
KIM, AIM and SYM versions.
DISK PROGRAM LIBRARY
Offers exchange of user contributed routines
and programs for HDE Disk Systems. Contact
Progressive Computer Software, Inc. for details.
HDE DISK BASIC
A full range disk BASIC for KIM based systems.
Includes PRINT USING, IF . . .THEN . . . ELSE.
Sequential and random file access and much
more. $175.00
HDE ADVANCED INTERACTIVE
DISASSEMBLER (AID)
Two pass disassemblerassigns labels and con-
structs source files for any object program.
Saves multiple files to disk. TIM, AIM, SYM, KIM
versions. $95.00
HDE ASSEMBLER
Advanced, two pass assembler with standard
mnemonics. KIM, TIM, SYM and KIM cassette
versions, $75.00 ($80.00 cassette)
HDE TEXT OUTPUT PROCESSING SYSTEM
(TOPS)
A comprehensive text processor with over 30
commands to format and output letters, docu-
ments, manuscripts. KIM, TIM and KIM cassette
versions. $135.00 {$142.50 cassette)
HDE DYNAMIC DEBUGGING TOOL (DDT)
Built in assembler/disassembler with program
controlled single step and dynamic breakpoint
entry/deletion. TIM, AIM, SYM, KIM AND KIM
cassette versions. $65.00 ($68.50 cassette)
HDE COMPREHENSIVE MEMORY TEST
(CMT)
Eight separate diagnostic routines for both
static and dynamic memory. 'ilM, AIM, SYM,
KIM and KIM cassette versions. $65.00 ($68.50
cassette)
AVASLABLE DIRECT OR FROM THESE FINE DEALERS:
Progressive Computer Software
405 Corbir Road
York, PA 1 7403
(7171845-4954
Johnson computers
Box 523
Medina, Ohio 44256
(216)725-4560
Lux Associates
20 Siinland Dfiue
Chico.CA 95926
(9161343-5033
Faik-BakerAssociates
382 Franklin Avenue
Nuliey. NJ07110
(201)661-2430
Laboratory Microcompjier Consultants
P.O. Box 84
East Amhetst, NY 14051
(716)689-7344
Periy Perfpfierals
P.O. Box 924
Miiier Place, NV 11754
(51 6) 744-6462
36
MICRO - The 6502/6809 Journal
No. 40 - September 1981
ASMLST: Full-Sized
Assembler Listing for AIM
ASMLST reads an AIM
20-colunin assembly listing
produced by the AIM ROM
assembler and reformats It into
a full-sized assembly listing.
Joel Swank
25730 Beach Drive
Rockaway OR 97136
The AIM 4K ROM assembler is one of
the most usehil features of the AIM.
You can enter assembler source code in-
to memory with the AIM editor, assem-
ble it directly from memory, and store
the object in memory for quick testing.
The AIM assembler can also read source
from any system device and write object
and assembly listing to any device.
The listing output of the AIM
assembler is designed for the AIM on-
board 20-column printer. Single
Statements are broken into as many as
three lines for the AIM printer. This for-
mat is fine for short programs, but
cumbersome for longer ones, and wastes
a lot of paper on a TTY or full size
printer. As the size of the programs I was
writing increased, 1 realized that I would
need full size listings. First I contacted
6502 software vendors, looking for a
full-feature AIM compatible assembler.
The only one I could find came with
disk systems. So, as a last resort I deci-
ded to write ASMLST.
ASMLST reads a listing generated by
the AIM assembler and constructs a full
size listing. The format of the listing
produced is similar to the listing format
in the AIM monitor program listing
manual. ASMLST produces a listing
with six fields. The first field is the four
character address. This address is taken
from the AIM listing lines beginning
with ' = = ' . The address is then updated
as each object code line is processed. It is
printed on each line, not just on the
lines with labels, as v/ith the AIM for-
Listing 1
)• ASltST *
rZEBD PM3E ST0BH2:
•
mxSfD EPZ $00 :
oumjT nffEx
LOC EPZ 501 jDXATICM CCUTIHl |
LOCL EPZ $01
UXS EI>Z $02
TSHP Era $03
TB^PORASY STCHtKE
CCDEIS EPZ $04
EIA3 ID FORCE PUTLIN
ECF EPZ $05
EMD OF FIXE FLAG
LOOJP EPZ $06
LOCATICM COWTER UPDATE
■AIM SUBHOUriHES
1
aaJ EQU 5E9FO
SEND CBLF TO ACD
BCHEK EQU SE»07
INTESEUPT C3iBCK
VCIBtEO EQU $BB71
OPEN cuiFtrr
MHEFEI EQO $£848
OPEN IHEUr
nBlLL EDO SE993
GET A CHARAL'i'liK
OUTftLL HttJ SE9BC
POT A CHRRnCTER
NLMfi HXJ $EM6
PUT A HEX HbfTE
PACK EfflJ SEAB4
ASCII TO HEX
EU12 ECU SE511
TAPE CLOSE ROUTINE
CCMIN EQU $E1A1
REIUBN TO MCHni:3{
EQU7VTES
OUiTUr LIKE FIEL£6
PISD EPZ $00
AEXRESS
CCCE EPZ S05
■OBJECr OXE
lAPPI. EPZ SOD
■lAFira,
OTCdE EPZ $14
-opcoce
OTEB EPZ $18
■OPERAND
CO* EPZ S24
■CC19IENI
CR EPZ SOD
IF EPZ 50fi
OTLZ EPZ $1A
OUTEIG EOU 5A413
fOUTPUT ceviCE
.' OSG $200
0200 2048E8
Pa^LST JSR VJHISEI
OPEN INPUT DEVICE
0203 2071E8
JSR WHEBEO
OraU OUTPUT DEVICE
0206 A905
lift #E05
0208 8503
SIR TH1P
SKIP 'JHE FIRST 5 LINES
020A 206103
SKLOOP JSR UtriLIH
020D C603
EEC TEMP
020F D0F9
EHE SKDOOP
0211 MOO
LCft #500
a, FAR lOCATICM MZREMEWT
0213 8506
STA LOCUP
0215 8505
STA ECF
AND END FTAG
0217 8501
OTA IJDCL
AND LCCRTICM OOUWJ'KK
0219 8502
STA IDCH
021B 20B3O3
JSK CLFDUT
I NIT OUnUT ffiJt'FiK
021E 2007E9
bKTUN JSR EOIEK
INTERRUPT?
0221 A505
run EOF
AT END?
0223 E029
BME CLOSE
YES. GO FINISH UP
022S 208103
JSR ULTLIN
G»rr A LINE
(Continued}
No, 40 - September 1981
MICRO - The 6502/6809 Journal
37
mat. The next field is the object code
field. This field contains to 3 bytes of
object code generated by the statement.
The iabel field is next, followed by the
opcode and operand fields. Last is the
comment field. The actual positions of
these fields are defined by equates in the
assembly source [see listing 1(.
Because of the format of the AIM
assembly listing, it is not always possi-
ble to tell how the source was entered.
One problem is that all comments are
printed on a separate line. This means
that ASMLST cannot tell whether a
comment was part of the preceding line
or entered on a separate line. But, if you
follow a few rules, you can enter yom'
source so that you get the desired
listing.
If you want a comment to be placed
at the end of a line in the comment field,
enter it on that line separated from the
operand by a blank, or instead, enter it
in column 1 of the following line. Both
of these methods generate the same
listing from the AIM assembler. This is
true except for comments on the ' = '
directive. The AIM print format for the
' = ' directive is different. If the com-
ment is entered on the same line as the
' = ' directive, the assembler will insert a
blank line between the directive and the
comment. So, if you want a comment
on an ' = ' directive, you must enter it in
the first column of the next line. If you
want a comment to appear on a line by
itself, you may enter it starting in col-
iimn two or greater. This will generate a
blank line and the comment will appear
starting in the label field. A comment
that follows a comment always appears
on a line by itself.
There is also a problem with the data
assignment directives |.BYTE, .WORD,
etc.]. ASMLST may not be able to keep
the address field updated properly if the
NOGEN listing option is used. When
you use NOGEN, the generated data
bytes are not printed, ASMLST must
count these bytes to keep the address
field updated. To avoid this problem you
must assemble with the GEN option or
specify only one operand on each direc-
tive.
ASMLST inserts a form feed ($0C)
when it detects a page break [from the
.PAGE directive). It deletes the first five
lines (PASS 1,PASS2, etc.] of the listing
and copies "ERROR messages are they
are. ASMLST is designed to work on
debugged listings; an error in your pro-
gram may foul it up. ASMLST
recognizes the .END directive as the end
of the listing.
0228 ADD103
lift LBUFl
jFIFSr CHARflLTER
022B
022B
.■FIRST CHRRACTOR CETEitatES ROUTINE |
022B
022B C920
CMP '
;BIANK?
022D D003
»iE HCBL
;NCS^
022F 4CB102
JMP BUIAN
0232 C93D
tKSL
(MP ' =
; EQUALS?
0234 D003
ttJE NOEQ
:NCFE
0236 4CF102
JMP BDHMJ
0239 C93B
CKSQ
CMP ';
.-SIMICCaCN?
023B D003
BNE MXCM
jNOPE
023D 4C1003
JMP CCMJAN
0240 C95F
NOCCM
CMP #S5F
;ONEeRSCORE?
0242 E003
EME NOPPG
jNOre
0244 4C2703
JMP PPGHBN
0247 C92A
hdpm:
CMP '•
lASTEKiac?
0249 C029
ENE HEXHAN
:N0, hBJST BE HEX CODE
024B 4C4503
JMP ASTTfflH
024E
024E
;CLOSi
: POT lAST LIHEE
, CLOSE TAPE,
024E
AND REIURN TO
MramoR
024E 209503
tXCSE
JSR PtTTLDJ
:SQ1D CURRBW LINE
0251 20ai03
JSR GETUH
:(ffiT LAST LINE
0254 A20D
IZK tlAREi,
;COPY TO CUTPirr BUFFER
0256 206803
JSR ODPOVR
0259 209503
JSR PtTIUN
;SBID IT
025C fi91A
USK tCTLZ
;SBiD A ccwnax-z
025E 20BCE9
JSR OUTALL
0261 20F0E9
JSR croF
0264 20F0E9
JSR CRIF
;AND A CXJtlPIA CRITS
0267 AD13A4
JJ3A OUi'iLG
;C31Et3< OUrPUr DEVICE
026A C954
CMP 'T
;IT IS TAPE?
026C D003
BJE tKJn^
;«0
026E 201 1E5
JSR DU12
;VES, CLOSE FlU]
0271 4CA1E1
NOTAP
JMP CCMIN
tbbiubn to monitor
0274
0274
:END OF MAINT.TNE
0274
0274
rlHE FOUiSilWG 6 ESXJTIMES EACH HflNDI£ 1 TiPE \
0274
OP INIVr LIKE
0274
0274
tBEXHAK : PROCESS LINE OT' CSJECT CCCG ]
0274
0274 A504
HEXHAN
lift OXEIN
;BEEM HERE CH THIS STMT?
0276 D006
BNE pmr
:YES
027B A500
im TsnEXD
fGET OUTPUT nJEBi
027A C915
CMP #opccxs:+i
rOPCCIE PFESEMT?
027C 9003
prr coPHEK
;KO, DCM'T SHJD
027E 209503
PUIC
JSR PUTLDJ
;YES, EVT CJMINr LINE
0281 AOOO
COPHEX liJY iSOO
;BB3D«I»G OF INPtfT
0283 A205
UK iCOEE
;0lTrPl7r INEEX
028S 8604
STX COEEIN
;SH3W WE REJTJ HhWi
0287 B9D103
C3JLUP
LEA LBUFI.Y
;C5Err A C3iAR
02aA C9CH)
CMP tCR
;EMD OF LINE?
OTPT FOia
urn PtriHEX
;YES, QO SIHD
028E C920
CMP '
; SPACE?
0290 FOOT
nun SKIPSP
jYES, GO FINiai LINE
0292 9D5104
STA IBUFO.X
fCOPy A CHAR
0295 C8
Diy
jBjMP POINTERS
0296 E8
IHX
0297 lOEE
BPL OiLUP
[NEXT CHARfiUl'KH
0299 206203
SKIPSP JSR UPLOC
;\JPDKrE ICCKTICH COUNTER
029C A007
ua #so7
029E A214
copcra) i£K itopcOTffi;
;OPO0Iffi; CFFSET
02A0 206A03
JSR COP0V2
iCOPY TO CfTTPlTT BUFF
02A3 4C1E02
JMP NXTLIN
;
02A6 206203
PtriHEX JSR UPLCC
lUIlftTt; LOCATICH OOUHTER
02fi9 8600
BVX. iNIEXO
.-MARK END OF LINE
02AB 209503
JSR PITTLIN
jSBSD LINE
02AE 4C1E02
JMP HXTLIN
;SEXr LINE
02B1
02B1
'jBUJK^
1 PROCESS LINE STARTD*; WTIH BUtfJK |
02B1
02B1 A500
BliSM
LDA HJDEXO
;WHERE IN OUTPUT LINE?
02B3 C90D
CMP IIABET.
;IAPira. PfiEbKHT?
02B5 9004
BCC NEWL
;N0, SEND LINE
02B7 C915
CMP #0PC0ESM-1
fOPCOCe PRESENT?
(Continuedl
t
38
MICRO - The 6502/6809 Journal
No. 40 - Seplember 1981
•
^
02B9 9003
per SCAHC :
NO. DCH'T SQID
02BB 209503
MEML
JSR FWUN 7
SfHD CUBBFin' LIKE
02HE ROOl
sense
isn #501 ;
STRRT SEABCH AT CCtUNK 1
02C0 B9D103
ELSCH
ua iBun,Y
SCAN TO FIRST NOJ-HEAbK
02C3 C90D
CMP #CR ;
WMCH FDR EHD
02C5 FOIC
BB;^ EMPLDl :
NULL LINE
02C7 C920
CMP ' ;
BIANK7
02C9 D003
B)E DOKHK :
NO, GO CHBJK FDR EOT
02CB C8
DW ;
NEOT CHAR
02CC 10F2
BPL BLSOi
02CE C92E
DOTtHK
CMP ■.
CHECK FOR END STKT
02XJ D009
EME SUXiP
NO
02D2 B9D203
lift I£UF1+1,Y
GOT A DIRKJTIVE, IS IT .HMD?
02D5 C945
CMP 'E
C2D7 D002
BNE BLCOP
NO
02D9 8505
STA EOF
YES, FL«; EWD OF FIIZ
02EB A214
BLCOP
LDX iOPCOCE
OUTPUT INDEX
02DD 206A03
JSR C0PtJV2
COPY REST OF LINE
02E0 4C1E02
JMP NXTLDi
BEJfT LINE
02E3 209503
EMPLIN JEF FUTLIN
SEND LINE
02E6 R920
lift ■
OTFfl 20BCES
JSR CUTALL
0?EB 2OF0E9
JSB CRLF
AND AN EMPTY LIKE
0?FF 4C1E02
JMP NXTLD)
NEXT LINE
02F1
02F1
Seghan
; PROnWi A LIKE BEGINNING WTIH ' = ' |
02F1
D2F1 209503
EC2!fiN
JSB PUTLIN
SEND LIKE IF ANY
02F4 A002
LOT #S02
POINT TO ADDRESS
02F6 205303
JSR (it'lHEX
CONVEKT HICW BYTE
02F9 8502
STA LCXH
SAVE IT IN LOCATICIJ OOUWIER
02FB 205303
JSR (JL'IHEX
CCHVEKT low BYTE
02FE 8501
STA LCCL
■SAVE
0300 B9D103
liA IBUFI.Y
-ANY WDBE?
0303 C90D
CMP #CB
0305 F006
BRJ JNEXTl
0307 CS
my
0308 A20D
UK tlABRT,
•PREPARE FOR lABKTi
030A 2O6A03
CCPLAB JSB C0POV2
-COPY lABEL
030D 4C1E02
JNEOTl
JMP NXTLDI
■NEXT LINE
0310
0310
■CCWHAK ! PROCESS A Oa«EHP
0310
0310 A600
(XMHAN UJX II^IEXO
:ANY LINE IN PROCESS
0312 F008
BEQ CCNLAE
;KO
0314 E024
CPX flCCMM
rPAOT CXM1EWT FIEED?
0316 B006
BCS COMCOP
;YES, USE VALUE
0318 A224
LDX #00*1
rNO, COPY TO Ca«EHT FIELD
03 lA D002
BNE CCMCOP
03:c A20D
CCMEJ^ LDX #1ABEL
;OOPY TO lARET,
031E 206803
CGMDDP JSR CCiWE
0321 209503
JSR PUTLIN
jSEMD LINE
0324 4C1E02
JMP NXTLIN
0327
0327
,-PAGi!flN : ETCCESS A NEW PPG
E
0327
0327 209503
PAGHAM JSR PUTLIN
;SmD CUBBFHT LINE
032A A90C
LOA #50c:
,-SEHD A EDIW IIJJJ
032C 20BCE9
JSR CXJTALL
032F A20D
IDX #1ABEL
;COPy UNIEBSCOBES TO lABEL
0331 206803
JSB COPOVR
0334 209503
JSB PUTLIN
;SE»D IT
0337 208103
JSB GPTLIN
;(At:]: TITIE
033A A20D
liK #IARF!,
;COPY TO OUTPUT LINE
033C 206803
JSR ODPOVB
033F 209503
JSR PUTLIN
iSEHD IT
0342 4C1E02
JMP NXTLIN
;KEXT LINE
0345
0345
;ASIHAN : PROCESS ERBOTf STA
TENEOT
0345
0345 209503
ASTHRN JSR PUTLIN
■SHJD CURREST LDJE
0348 A205
IDX «CODE
034A 206803
JSR COPOVR
■COPY "TO OUI'PUT BUFF
034D 209503
JSR PUTLIN
-SEHD IT
0350 4CiE02
JMP tKILIB
0353
0353
0353
:SUBRCX/riNES POLDJW
(Continued^
ASMLST inputs an AIM assembly
listing from the AID (Active Input
Device! ^nd outputs the new listing to
the ADD (Active Output Device). Start
ASMLST at $200. You vrill receive the
Standard IN = and OUT = prompts for
the input and output devices. You can
input from tape and send the output to a
printer through the user port or to a TTY
or CRT through the AIM TTY port. You
can also input from tape and output to
tape, if you have two remote controlled
tape recorders. For long listings you may
want to partition the listing output with
the LIST and NOUST Options. This is
fine as long as you are sure that the
.END statement is listed so that
ASMLST can recognize the end of the
listing.
ASMLST works if you have a full
sized printer or terminal, but what
about those of us with only the AIM
20-colunm printer? Help is available
with 'SPLIT' program, which allows the
AIM printer to print listings up 80
characters wide. It inputs the output
from ASMLST and splits it into
20-column sections for printing on the
AIM onboard printer. You then cut and
paste to create a full width listing. Ex-
ecute SPLIT at $200 and it will first pro-
mpt the section to be printed. Each sec-
tion is 20 columns wide and numbered 1
to 4. Section I is columns 1-20, section
2 is columns 21-40, and so on, SPLIT
then issues the standard IN= and
OUT = prompts. The input file must be
read once to print each section. The
number of sections allowed can be in-
creased to 7, simply by changing the
value in the compare instruction at
$221. The size of each section is con-
trolled by the value assigned to the label
'SIZE'. If you would like to use ASMLST
with SPLIT, you may want to change
the equates in ASMLST for the output
line fields as follows:
ADD
=
CODE
= 5
LABEL
= 12
OPCODE
= 19
OPER
= 23
COMM
= 31
ASMLST then produces a listing for-
mat that wUl fit into 40 columns. This
leaves only 10 columns for the com-
ment field. The 40- column format
makes the most efficient use of two
passes of SPLIT On the AIM printer.
ASMLST and SPLIT are especially
valuable if you want to publish a pro-
gram in a magazine or newsletter. The
reader will appreciate the increased
readability of your listing. You can also
use SPLIT to print BASIC files. In fact
any ASCII file that ends with a Control-
Z can be printed in sections with SPLIT.
No. 40 - September 1981
MICRO - The 6502/6809 Journal
as
Co
6?
,e^
^•■O-N
NEW & USED SYSTEMS
• HARDWARE
• SOFTWARE
•PARTS
•ACCESSORIES
-SERVICE AVAILA6LE-
SUrSET CLECTroriCS
2254 TARAVAL ST.
SAN FRANCISCO, CA 94116
(415)665-6330
0353
0353
0353
;GETHEX : GET A BYTE OF ASCII HEX FKM njPUT LINE
aVi
0353
0353 B9D103
GETIHEK LDA IBUFI.Y ;lit.T HIO! NYBBIE
%
0356 2084EA
JSR PACK ;CC«VERr TO BINftRi
0359 C8
IHY
035A B9D103
Ulft IflUFI.Y ;(ST LO NYBBIE
035D 2084Eft
JSR PACK ;CCSVERT TO BIN
0360 C8
nre
0361 60
tas
0362
0362
lUPUX ; SAVE irTATICW COOBTEE INCFBffiMT
0362
0362 ca
UPLOC nre ;BLMP POIKIER
0363 96
TiA
0364 4A
LSR iDIVICE BY 2
0365 8506
STA lOCUP fSftVE
0367 60
RTS
0366
0368
:COTOVER : COPt ALL OR -PART OF THE INPUT LDJE TO THE
0368
dTTPlTr BUFBEB AT OFFSET IN X
0368
0366 AOOO
COPOVR LDY #S0O jBEGINNING OF INPUT LINE
036A
lEwnar to copy pabtial line
036A B9D103
ODEOV2 urn IBUFI.Y ;Uii'J' A CHAR
036D C9CK)
CMP #CR ;END7
036F FOOD
BED COPOtTT lYES, QdIT
0371 C93D
C«P '= .-CHECK FOR ' = ' DIRECTIVE
0373 D002
HJE ETOCH ,-HOPE
0375 8504
STA COEEIN jROffiMBER
0377 9D5104
SrOOJ STA IBUK),X ;STDRE IN OOMWT BUFFER
037A E8
INX jNEXT
037B C8
DJY rKEXT
037C lOEC
BPL COTOT2
037E 6600
COPCUT ffTX mUtlXD ;SAVE LAST
0380 60
BTS
0381
0381
.-mm.TW ! ct:t CME LINE IMIO INRn" BLUTER
0381
,1 V 1
0391 AOOO
GETTLIM nW #500 ;BEGINmH3
u| '
0383 2093E9
GE:rC3iR JSR IN?\LL ;(Jh7J' A CHAR
0386 C90A
OTP #IF :LDJE FQD?
0388 F0F9
RFTi GETCHR ,-YES, lOXXE IT
03aA 99D103
STA t£UFI,Y .-SAVE
038D C90D
CMP #CH .-IMD7
038F F003
BHO GCOTJH fVES, COIT
0391 C8
INY
0392 lOEF
BPL C!PrC3ffl ;NE<T CHAR
0394 60
(XnuN RTS
0395
0395
jPtnr.TH i SO© OUTPUT EUFFFS. TO CXJTPUT DEVICE
0395
0395 fiSOO
PtTTUN IHR IJXCXO ;AI«THI»3 THhKLi'
0397 F037
BSa NOPUT ;tK>, aaPPIT
0399 A502
Lm ICCH ;(^T HI BOTE Cf LOC CCXWTES
039B 2046EA
JSR NUMA ;SEHD TO CUITUT
039E A501
IDA im, ;yfc"!' LO BYTE
03A0 2046Eft
JSR NUMA .-SOU IT
03A3 A204
UK #S04 jINIT INEEX
03A5 BD5104
PUTCHR ICA IBUEO,X ;(=tT A CHAR
03ft8 20ECE9
JSR OUTALL ;EEMD IT
03AB ES
INX
03AC E400
CPX IMKMD .-IMD OF LINE?
03AE 9(F5
BCC PUTCHR JKO
03B0 2OF0E9
JSR CHLe ; TERMINATE LINE
03B3 A27F
CLEOUT IIJX #?7F rCLEAR OUTPUT BUFFER
03B5 A920
ISA '
03B7 9D5104
CLRLUP Sffi IBUEO.X
03BA CA
rax
03BB lOFA
BPL CLRLUP
03BD A506
LTR LOCUP rUmATE IDCATICK COWIER
03BF 18
CLC
03C0 6501
AEC lOO.
03C2 8501
SEA UXL
0X4 9002
Btx: Nocy
03C6 E602
WC UXH
A'
03C8 A900
NOCY IJ» #500 sCLEAR DATA
{Continued/
1
40
MICRO -The 6502/6809 Journal
No. 40 - September 1981
•
^
%
03Cft 8506
03CC S500
03CE 8504
03D0 60
03D1
03D1
03D1
0A51
OADl
04D1
anft LOCUP
STA ratSMH
STA COEEIN
NOPUT RTS
BUFFERS
IBUFI
1£UF0
ESS 580
CFE S80
Listing 2
':* SPhl'T *
;ZEHO P«3E STORAGE
(XdNT EPZ 500
CHABAIL'I'EH COUWT
SECTCW EPZ SOI
CURRENT SECTION
;AIM SUBROUTINES
BLANK B30 SE83E
SHJD BLANK ID D/P
REDOUT ECU SE973
INPin- AW ASCII CHAR
CBLF ECU SE9F0
SEND CRLF TO AOD
RCHEK EOO 5E907
IbTTERFUPT CHECK
WHEBEO ECU 5E87I
OPEM OUTPl/r
WHEREI ECU SE848
OPEN INPUT
INALL EQU 5E993
GET A CHARACTER
Ot/IALL EQU 5E9BC
PITT A CHARAUTKR
CKEBOO EQU 5E394
DISPLAY 'ERBDR'
Oimvr EQU SE97fl
EQJD TO DISPIAY
DU12 EQU SE511
TAPE OjGGE ROUTINE
CCWIN ECU 5E1A1
REiuRN TO m:*iitor
lECUATEE
CF ECU 50D
CaZ ECU SIA
SIZE EQU 514
IF BOO SOA
aUTFUS ECU SA413
ORG 50200
Cej 50800
0200 AOOO
SPLIT UHY #500 :
INIT INEEX
0202 B9AF02
MSGLUP HA MESSxY ;
CTT A CHAR
0205 F006
RFTI GSPLIT
QUIT CH ZEUO
0207 207AE9
JSB OUTPUT ;
DISPLAY IT
020fi C8
INY
020B 10F5
BPL MSGLUP
NEXT
020D 2073E9
GSPLIT JSR REDCUT
GET REPLY
0210 C931
CMP '1
IB3AL (1 TO 4)7
0212 9004
BCC BAEMW
NO
0214 C935
CMP '5
0216 9009
BCC GCOCWI
YES
0218 2094E3
aAEHUM JSR CKEROO
PRINT ERROR MSG
021B 20FOE9
JSR CRIF
021E 4C0002
JMP SPLIT
TRY ?GAIH
0221 2907
GOOEtK AND #507
riFAR HI BYTES
0223 8501
STA SECTCW
SAVE IT
0225 203EEa
JSR BLftHK
0228 204KS
JSR WHERE!
OPSJ INPUT
022B 3071E8
JSR WHERFD
OPEN OUTPUT
022E 205802
^]XTLIN JSR Gfl'LDJ
GET A LINE FRCM DJiVT DBTCE
0231 B009
BCE FIH
QUIT CS OTLZ
0233 209502
JSR SPIOK
CfiK^UIATE SPLIT
0236 207BOZ
JSR PITTLIH
SEND LIKE
0239 4C2E02
JMP NXTLDI
GET AtKTHER LINE
023C AD13A4
FIN LDA OUTFLG
CHECK OtTTPUT DEVICE
023F C950
CMP 'P
PRINTTE?
0241 F012
MO N3TAP
-YES SKIP ECF MARK
0243 A91A
LEft #CTL2
-SQiD A CCHTROL-Z
0245 2CffiCE9
JSR CUTALL
0248 20F0E9
JSR CRlf
024B 20F0E9
JSR CFIF
■AND 2 CBLFS
024E C954
CMP 'T
;IS IT TAPE?
0250 D003
BJE KOTAP
:N0
0252 2011E5
JSR DU12
■YES, CLOSE FIIF
0255 4CA1E1
NOTAP JMP cans
;RETUBH TO MONITOR
0256
;EHD OF MAINLINE
0258
7 SUBROUTINES FOUO*
0258
0258
iCETLIN : OT ONE LINE INTC
INEUT BUFFER {Continued)
TAKE
Unique Data Systems has.
We've taken Rockv/ell's AIM
65 Microcomputer, packaged
it in a professional enclosure
and turned it into a versatile,
higtier capacity microcomputer
system. Complete with a
memory-l/0 board, modem
board or wire wrap proto-
typing board, power supply,
cables and connectors. It
mai<es the AIM 65 a joy to
work with, and there's even
space inside for your own
special circuitry. We'll sell
you the whole package or just
the bits and pieces you need
for your application. We're
AIM 65 specialists. We're
Unique Data Systems.
- '-kkkkkki
Unique Data Systems
15041 Moran Street
Westminster, CA 92603
(714)895-3455
No, 40 -September 1981
MICRO - The 6502/6809 Journal
41
FOR YOUR APPLE
LANGUAGE SYSTEM
APPLESOFT: 30.3 MIN.
MICROSPEED; 3.9 MIN.
ri-iij I l_0 1 . TIMES FASTER
TH*W APPLESOFT
MOST
POWERFUL: ^^r^^^^iyr
PASCAL OH FOHTFAN
EXPANDABLE: ^■'^,"?oRm' ^*^^°
CREATIVE: -."°-™","='-- ^
USER-FRIENDLY: .^^tIVTa'!..
0258
0258 A080
(jfl'LIB UTf #580
n.FAR BUFfER
025A A920
UA '
025C 998602
CLRLUP
STA LBUF.Y
A>i
02 SP 86
EGY
1^
0260 EOFA
ajE CLSLUP
r
0262 2093E9
GETCHR
JER INALL
UET A CHftR
0265 CSOft
CMP iLF
LIKE b'tM)?
0267 F0F9
BEQ GETCHR
YES, ICMZSffi IT
0269 C91A
CMP ICTLZ
END OF FII£7
026B FOOC
BEQ ZOOT
YES
026D 996802
STA IBUF.Y
SAVE
0270 C90D
CKP #CR
END?
0272 F003
BED GOTLIN
-YES, COIT
0274 C8
IMY
0275 lOEB
BPL GEICHR
NEXT CHAR
0277 18
GCTLIN CLC
0378 60
RTS
0279 38
TOUT
EEC
027A 60
KHJ
027B
027B
iFUTLDJ : SEND arrp[/r buffek td ouwot device
027 B
027B A914
KTTLIN
UlA #SIZE
INIT CHAR COtWF
027D 8500
STA COUNT
027F B9B802
PRLUP
L£A LBUF.Y
■GET A CHARACTER
02B2 C9{m
OIP *CR
END OF LINE?
0284 POOS
BEQ £»:».
-YES
0286 20BCE9
JSR OUTALL
0289 C8
XMY
02aA C600
DEC COUHT
COUNT IT
028C COFl
BfJE PRIJJP
CCNTINUE u^^■IL size
028E 2007E9
EOL
JSR RCHEK
■CHECK FOR I^f^ERRUPT
0291 20F0E9
JSR CRIT
■END LINE
0294 60
RTS
0295
0295
rSPITHK : SET Y PQE PROPER
3DCTICN OP LISTING
0295
1
0295 A601
SPITHK
LEK SECICK
-lit'l' SECTION NUhBER
F
0297 AOOO
UW #SO0
BB3 INNING OF LINE
0299 CA
SPUJPl
DEX
■COUbfT SECTICN
\
029A P012
BEO SPOUT
■DUN
(|i
029C A914
LEft (SIZE
■GET LINESISE
029E 8SO0
STA COISOT
I
02A0 B9B802
SPL1JP2
LEfi LBUF.Y
■GET A CS1AR
02A3 C90D
CMP fCE
END OF LINE?
02A5 F007
BEO SPCUT
YES. QUIT
02A7 C8
INY
02Aa C600
rac co(MT
-END OP SECTICN7
02AA D0F4
EWE SPLUP2
-NO, GET ANOTHER CHAR
02AC FOEB
BEO SPLUPl
-YES, TRY NEXT SECTltW
02AE 60
SFOffT
RTS
02AF 534543
MESG
ASC 'EECTIC**-'
02B2 54494F
03B5 4E3D
02B7 00
HEX 00
02B8
; BUFFER
02Be
;
093B
IflUF
DPS S80
Note: When
the AIM
assembler If yo
u are using tape for both source
i
REQUIRES
48K APPLE II or 11+ SINGLE DISK
SEE YOUR DEALER OR CONTACT:
r"
. applied analytics incorppraied
■.n
B9IOBrDokndgeDr.. Suae dOS.Uppci Marlboro, Md 20370
(301) 627-6650
rm IrlEresled: Please Send
D 160 Page Manual >3S,00
D Delailed Information
Name ^
Address
Cily
Slate
Z\o.
listing is directed to tape, the assembler
does not properly close the file at the
end of the assembly: This will cause the
last block of data to never be written. To
circumvent this problem you must run
one of [he following programs immedi-
ately after the assembly is finished.
If you are using any device EXCEPT
tape for the source input, then execute
the following routine:
CLD
JSR E511 (close tape file)
JWP E1A1 (return to AIM)
input and listing output, execute the
following program:
CLD
LDA #54
(move T to INFLG
STAA412
and OUTFLG so
alternate buffer
STA A413
will be used.)
JSR E511
(close tape file)
JMP E1A1
(return to AIM)
I
Either of these programs can be lo-
cated in any imused spot in memory and
can be executed with the GO command.
jucno
42
MICRO - The 6502/6809 Journal
No. 40 - September 1981
AIM-65/SYM-PET-KIM-6800
Universal Interface Board Converts AIM-65/SYM
Into Professional Data Logger
MINI MOTHER
BOARD
ADDRESS
SELECTION
(CLOCK, MUX
A/D)
1E CHANNEL'
MUX
BANK SELECT —
ADDRESS
IMEMOHY)
ie A/D INPUTS
» t 15 VOLT
POWER
SUPPLY
INPUTS
COLUMBUS INSTRUMENTS INTERNATIONAL CORPORflTtON
^^^^^^^ 9ii0nliT' OHnO-'lOuBl InlliNrtflnli Bnd lalal ■nnjiiirinf ijUbhii
9S0N. HAGUE AVE.. COLUMBUS. OHIO 43204U.S.A.
PHONE: (614) 48S-6176 TELEX: 2«514
(Also connects to PET or KIM with adapter cable.
Adaptable to other 6502 and 6800 systems)
CONTAINS:
* 12 bits, 16 channels, fast A/D converter
* space for additional 16K RAM memory or 32K
EPROM (or combinationj
* real time clock/calendar with real time interrupt
capability and 10-year lithium battery backup
* plugs directly into AIM-65 expansion connector
with the help of a mini-mother board which
supports up to three interface boards
* supplied with supportive demonstration and
control programs
AVAILABLE MODELS:
* IB-902 Additional Memory
Space (only) $ 390.00
* IB-902-A Calendar/Clock plus
memory space $ 690.00
* IB-902-B A/D (12 bits, 16 channels
plus memory space) $ 960.00
* IB-902-AB A/D, plus memory space
and calendar/clock $1,270,00
Mini mother board lo support up to three (3)
interface boards $65.00
Quantitij Discounts Available
^
.. aw if^ti"'^
' Li .-"■■ : 11,717
1^
■>
\ ,iltn4''^f^'\9*
BETA 32K BYTE EXPANDABLE RAM FOR
6502 AND fi8(Ml SYSTEMS
AIM 65 KIM SVM PET S4<-BUS
■ Plug conipaliblp wilh the ATM-65/SVM cxpan-
^\iM\ c:i>iintclc)r by u^in^ a rililil angle c;Mnn«*-
tor (supplied),
• MeniiJTV bfiard ed^C L-oiiiitthjr plugs into the
6800 S^4 biis,
■ CoiiiwcLs to PET iisifift an adaplnr cable,
• UsfTv +5V unly, suppli^ From tht hott com-
puter.
■ Pull documentation r Assembled and tested
birards are ^laranieed For one Full year.
Purchase price is fully refundable IF board is
relumed uiidariiaji^ed within \A day^.
Assembled with 32K BAM 3349.00
& Tested wi^^ I6K RAM 321). 00
Rare hi>ari], manual & hard-t'f-get parts 99.00
PE r intcrFate kit. Connects (he 3£K lUM board
Iua4KnrfiKPET $ 69.00
^ee ourfvU page ad in BYTE and INTERFACE
AGE.
wabash
S" iir 5V," f|<;\il)lL' diskcltfs ii'iiilkd Ifld
prror free wilh maiiiifat'liirfrv .5 vear limitetJ
warranty on all 8" mpdia. Soft .sectored in tilt-
bacfc' bojHK of 10, 5'/." available in 10 Sector,
(Add $3.(>0}iir plattii- library cases)
R" single sided, .single density.., $29.95
8" ■iinjik sidKc], double densily 3,7.95
8" double sidtd, dmilile density 48.95
.'I'/r" -single sided, single density 27.95
5'/i" single ^ided, double density 29.95
'Till'Bdck Is a rradn^nurk i]f Wdl»H\li, Inc.
8" DISK DRIVES
ShiigarlSOIR S3W).00
NEC FD1160(do(ible sided) 595,00
Memorex MBX-IOI 8" Winehc^ter .style, hard
disk drive, 10 megabytes $2,000.00
$29.00
16 K MEMORY
EXPANSION KIT
For Apple, TRS-80 keybuard, Ejidy, and all
other sy^Iem.'i using 4 1 Ifi dynamic rams or
equivalentr All IC's are primt' Mitsubfehi MK
4J1R-3.
• 200 NSEC access, 375 NSEC cycle
■ Bumed-in and h]llv (efiled
■ I hill year parts re^ilaeemenl guarantee
ROCKWELL AIM 65
AIM 65 with !K ram $425.00
AIM 65 with itK ram 485. iX>
AIM power supply 125. DO
Professional AIM enclosure 169,00
Budget AIM cnclo.sure 50. tX)
KIM endiMiire 40.00
SYM enclosure 30.00
TERMS: Minimum order $ 15.00. Mmimitiii
.vhippiJig and handling $3.(X) Calij. residents
add G% i,ati's lui Cnsh. checks, Ma^mrcartl,
Visa and purchase orders from liuolificd Jirms
aitd inslitulianv arc. accepted. Product availabili-
ty and pricing are subject to change without
notice.
INTERNATIONAL ORDERS: Add J,1 % lo pur-
chase price for all orders. Minimttin shipping
nharj^r iv S20.0ff, Ordern wilh insufficient fundi
will he delaijcil Excess funds will hi- relumed
wilh your order. Alt jtrit-e-^ are U.S. only.
cpmpureR Dewca
IS30 tU.COUinJ ftVE.
ORAHGE. Cn 99668
<7r4)633-7fi80
No, 40 -September 1981
MICRO - The 6502/6609 Journal
43
M
us*.
space
age
micro
^
»tiH,
%.
%
'-m
V' v^
Used at NASA,
Kennedy ^ace Center
With Multiple Applications Related
,. to the Columbia Space Shuttle Project
%
T
P I
■fc.-
JiRY WELCOME.
JINI MICRO-SYSTEMS, Inc
DATABASE MANAGEMENT SYSTEM DESIGN
BOX274KINGSBRIDGESTN,.RlVERDALE, N.Y. 10463 (212)796-6200
AMCRO
New Publications
Mike Rowe
New Publications
34 Chelmsford Street
P.O. Box 6502
Chelmsford, MA 01824
6809
CHROAIASETTE Magazine is a monthly
issued on cassette tape and devoted en-
tirely to the TRS-80 Extended BASIC
Color Computer. The first issue appeared
in fuly 1981. Each monthly tape con-
tains six to eight programs that directly
load and run on the color computer.
They include games, tutorials, utilities,
and application programs by various
authors. The same publisher issues
CLOAD Magazine, for the TRS-80
Models I and IH, Subscriptions are
available for one year ($45.00] or half-a-
year |$25.00| from CHROMASETTE
Magazine, P.O. Box 1087, Santa Bar-
bara, California 93102.
Atari
The Atari Assembler by Don Inman and
Kurt Inman. Reston Publishing Com-
pany, Inc. (Reston, Virginia), 1981, xii,
270 pages, 78 illustrations, 6M x 9Vi
inches.
ISBN: 0-8359-0237-4 (cloth) $14.95
ISBN: 0-8359-0236-6 (paper) $ 9.95
This is an introduction to assembly
language programining for use with the
Atari Assembler Cartridge. The book is
written for the beginning assembly
language programmer who has some
knowledge of BASIC.
CONTENTS: Introduction— Computet
Architccmrcj Review of BASIC; Graphics
Keywords. MacbitJe Language from
BASIC— Binary Number Pa Items; Hex-
adecimal Notation; Hexadecimal-ro-
Decimal Conversion; How the Machine
Language Program Works; Summary; Exer-
cises; Answers, Memory Use—Atari
Memory Map, How BASIC Finds the
Machine Language Program; Passing
Variables to Machine Language Subroutine;
Using the One-Variable Program; Passing
Mote Than One Variable; A Machme
Language Loop; New Instructions Used;
Tracing Through the Subroutine; Summary;
Exercises; Answers. Getting Started with
the Assembler— The Writer/ Ed it or; The
Assembler Program; Executing the Machine
Language Program— The Debugger; Sum-
mary; Exercises; Answers. Special-Purpose
Registers and Addressing Modes— The
Accumulator; the X and Y Registers; The
Processor Status Register^ The Stack Pointer
Register; Addressing, Modes; Summary;
Exercises; Ariswers, Branching Out— Ex-
amples Using Forward Branches; Examples
Using Backward Branches; Using the Carry
Flag; Using the Zero Flag; Using the
Negative Flag; The Overflow Flag; Sum-
mary; Exercises; Answers, Assembler
Review— Source Program Format; Methods
to Use Operands; The Assembler Writer/
Editor Mode; The Debug Mode^ Exercises;
Answers, Designing a Program — Absolute
Indexed Addressing; Using the Add Five
Pairs of Numbers Program,- Using the Add
Ten Program; A Variation of the Add Ten
Program; Yet Another Variation; Summary;
Exercises; Answers. Addition and
Subtraction— Two-^yte Addition; Two Pro-
grams in Memory; Two-Byte Subtraction;
Negative NumberSi Multiple-Byte Addition
and Subtraction; Decimal Arithmetic; Sum-
mary; Exercises; Answers. Shift and
Rotate— /U-ithme tic Shift Left; Logical Shift
Right; Rotate Left; Rotate Right; Summary;
Exercises; Answers. MultipUcalion, Divi-
sion, and Subroutines- Eight-Bit Multi-
plication; Using the S-Bit Multiplication
Program; Eight-Bit Division; Subroutines;
Using a Subroutine; Summary; Exercises;
Answers. Programming Practice— Using a
Logic Function; Entering the Subroutine;
Program to Sound Off; Play Notes Program;
Program to Shape Sound; Program to Print
on the Screen; You're On Your Own. Ap-
pendix A-6501 Instructions- Flags Affected.
Appendix B— 6502 Instructions— Address-
ing Modes, Appendix C— Frequency Values
for Three-Octave Scale, Appendix D— Atari
Assembler Enor Codes, Appendix £— Atari
Operating System Errors. Appendix
F— ATASCU Character Set, Index.
AIM
The Take AIM Manual, Volume 1 by
James Hoyt Clark, Matrix Publishers,
Inc, (11000 S,W, llih, Beaverton,
Oregon 97005], 1981, xii, 388 pages,
diagrams, drawings, listings, 8!^ x 11
inches, paperbound,
ISBN: 0-91646O-29-0 $16,95
This manual is designed as an addition
to the AIM 65 documentation that is
enclosed with the AIM 65, To use this
manual successfully, a reader must first
he able to use the AIM 65 documentation,
CONTENTS: How To Use This Manual.
The Forma] Introduction— The AIM 65
Hardware; The PERSONi Some Useful
Steps— Software Example. In The Begin-
ning—A Short History; The Sixteen Com-
mandments of Microcomputers; OODO
CAUTiON; 1 0001 POWER; 2 0010 WIR-
ING; 3 0011 The Foundation; 4 0100 IN-
SIGHT /OUTSIGHT; 5 0101 & 6 01 10 Info
Sources; 7 0111 Micro Chauvinist; 8 1000
NOP; 9 1001 Other Programs— the LAW; A
1010 Checking with the Neighbor; B 1011
&C II00Q& A's;D 1101 Storage; E 1 1 10
The Every Half Hour Be Carefuls; F 1111 An
Understanding, The Language of the AIM 65
—The Hex Format; The Mnemonic Format;
The ASCII Text Format; The EDITOR and
ASSEMBLER; The Cost of Assembling;
How to Input the TAKE AIM Programs,
Mjcrocornpuler Basics — Memory; Some
Programming Information; The Brains— the
6502 Microprocessor; The Heart- Clocks
and Timing, AIM 65 Documentation Ex-
plained— Manuals, Cards, and a Chart; The
Chicken or the Egg; User's Guide; The
Monitor Program Listing; 6500 Micro-
processor Programming Reference Card;
The AIM 65 Wall Chart; The Monitor and
Editor Subroutines, The AIM 65 Documen-
tation Index. The AIM 65 Display— The
Display Hardware; DISPLAYING; The AIM
65 Keyboard— The Keyboard Hardware;
KEYING; KBINT Program; ASCII Program;
DEMCU Program. Versatile Interface Adap-
tor IVIA)—The 6522 Homologous Homun-
cular Warehouse; Diagram of the VIA 6522;
VIA Data Output Register Schematics;
Summary of VIA Control Registers; Sum-
mary of VIA Commands, Glossary. The
GAIMS Programs— BINARY TO HEX-
ADECIMAL CONVERSION Program —
BINHX; CARDS Program— CARDS; REAC-
TION TIMER Program-REACT;
GOLLUM'S CAVERNS Program— GC; ESP
Program — ESP; BAGELS Program —
BAGEL; BRICKS Proglam-BRICK;
HANGMAN Program- HANGM; nc TAC
TOE Program— TIC; STARWAY 090 Pro-
gram— STAR9- TJie UTIUTY Programs—
ROTATING BILLBOARD — ROTBB;
PRINTER WAVES Program— PRTWV; AD-
DITION & SUBTRACTION— ADDSB;
TOTAL Program- TOTAL; TIMER Pro-
gram— TIMER; Printer Paper Programs;
MEMORY TEST Program— M TEST; Hex-
adecimal Input/Output Programs; EDITOR
RESTORE Program — ESTOR; SUPER
SIGNS Program — SIGNS; CONVERT
DECIMAL TO HEX Program— CNVRT;
SYMBOL TABLE— SYMTB; FIELD SORT
Program— PSORT; RELOCATE MEMORY
Program- RLOC; DISASSEMBLY 1-STEP
Program— KISTP; FIBBONACCI NUMBER
SERIES Program— FIBBN, The Appen-
dix-Con lents—ROCKWELh Specification
Sheets; Questions for the TAKE AIM
Manual; Worksheets and Memory Page
Samples; Reply Form.
Pascal
Pascal Piogiams (or Scientists and
Engineeis by Alan R. Miller. Sybex Inc.
(2344 Sixth Street, Berkeley, California
94710), 1981, xxii, 378 pages, 134
listings and illustrations, 7x9 inches,
paperboimd.
ISBN: 0-89588-058-X $16,95
This book was written to help readers
gain a proficiency in Pascal and to pro-
IContinued on next page)
No. 40 -September 1981
MICRO - The 6502/6809 Journal
45
New Publications
{Continued fiom page 45)
vide a library of programs useful for
solving problems frequently encoun-
tered in science and engineering. It con-
tains over 60 of the most frequently
used scientific algorithms, along with
their program implementation in
Pascal. The book is designed not only
for the practicing scientist or engineer
but is also suitable for a junior- or
senior-level engineering course in
numerical methods. Users need a work-
ing knowledge of an applications
language (Pascal, FORTRAN, or BASIC|.
Experience with vector operations and
differential and integral calculus is also
recommended by the authors.
CONTENTS: Evaluation of a Pascal Com-
plies— Introduction; Precision and Range oi
Floating-Point Opeiationsi Pascal Program:
A Test of the Floating-Point Operations^
Pascal SIN and COS Functions; Pascal Pro-
gram; Testing the SIN Function; Other
Pascal Functions; External Files; A Power-
of-10 Function; Pascal Program: Calculating
Powers of 10; Summary. Mean and Standard
Deviation— Introduction; The Mean; The
Standard Deviation; Pascal Piogiam: Mean
and Standard Deviation; Random Numbers;
Pascal Function: A Random Number
Generator; Pascal Program: Evaluation of a
Random Number Generator; Pascal Func-
tion: Gaussian Random Number Generator;
Pascal Program: Evaluating RANDG; Sum-
mary, Vector and Matrix Operations—
Introduction; Scalars and Arrays; Vectors;
Matrices; Pascal Program: Matrix Multi-
plication; Determinants; Pascal Program:
Determinants; Inverse Matrices and Matrix
Division; Summary. Simultaneous Solution
of Linear EquatJonj— introduction; Linear
Equations and Simultaneous Equations;
Solution by Cramer's Rule; Pascal Program:
A More Elegant Use of Cramer's Rule; Solu-
tion by Gauss Elimination; Pascal Program:
The Gauss Elimination Method; Solution
by Gauss-Iordan Elimination; Pascal Pro-
gram: Gauss-Ioidan Elimination; Multiple
Constant Vectors and Matrix Inversion;
Pascal Program: Gauss-Jordan Elimination,
Version Two; 111 -Conditioned Equations;
Pascal Program: Solving Hilbert Matrices; A
Simultaneous Best Fit; Pascal Program; The
Best Fit Solution; Equations with Complex
Coefficients; Pascal Program: Simultaneous
Equations with Complex Coefficients; The
Gauss-Seidel Iterative Method; Pascal Pro-
gram; The Gauss-Seidel Method; Summary.
Development of a Curve-Fitting Pro-
gram—Introduction; The Main Program; A
Printer Plotter Routine; A Simulated Curve
Fit; The Curve-Fitting Algorithm; The Cor-
relation Coefficient; Pascal Program: Least-
Squares Curve Fitting for Simulated Data;
Summary. Sorting— Introduction; Handling
Experimental Data; A Bubble Sort; Pascal
Program; The Bubble Sort and TSTSORT;
CBM/PET? SEE SKYLES ... CBM/PET?
**Should we call it Command-O
or Command-O-Pro?"
That's a problem because this popular ROM is
called the Command-O-Pro in Europe. (Maybe
Command-O smacks too much of the military.)
Bui whaieviT you call ii. ihis ^K by:e ROM will provide your CBM BASIC 4.0 (4016.
40321 and 8032 i;ompulcrs v/itli 20 addilional cominands including 10 Toolkit progiam
i-dilins and dcbuggmg command!, and 10 addilional commands for ^cicenmB, formallmB
and diw.- file mampulalmg. (And our manual wile, dug up i9 addilional commardi m Ihs
toui5e ol doing a IS-page manual!)
V\K Command-O esu-iids Commodore's 8032 advanced screen editing realures lo Ihe iilti-
maic Vou can iioi* SCROLL up and down, insert or delcic enure lini-s, dclele ihe cliar-
aclers lo ihe lefl or righl or the cursor, select TEXT or ORAPHICS modes or ring ihe
8032 bell You can even redefine Ihc -vjiidow 10 adjust it by size and posilion on your
screen. And you can define any key Lo equal a seqiictice of up 10 90 key strokes.
The Command-O chip resides in hexadecimal address J9000. Ihc rightmost empty iock el
in 4016 and 4032 or the rearmosi in 8032. If iherc is a space tonnicl. we do have Ijockel-
2-Mt available al a very special price.
Skyles egaranlees )»ur sal istae lion: U you are nol absolulely happy -viih your new
Ca"mmard-0. relurn h to us within icn days lor an immediale, full refund.
(ommand-O from SkjIesKleelric Works S75.WI
Complcic with Sockel-2-Me '*■'*
Shipping and Handling (USA /Canada/ S2.50 fEurope/Asia) SIO.OO
California residents muil add 6%/6'A % sales lax, as required.
Skvles EleclriC Works Vlsa/Masurcatd orders; cah LollfTec
231K South WhLsmanHoad (8001 227-imS (exccpi California)
Mountain Vie». CallforniB ^4041 Cahlornia orders; please call (4I&)
(4151 965-n3S 965-1735.
/lAiaO - S31A>IS 33S 6i3d/IAiaD </>
46
MICRO - The 6502/6809 Journal
Pascal Procedure; Bubble Sort with SWAP;
A Shell Sort; Pascal Procedure; The Shell-
MeczQcr Soil; The Quick Sort; Pascal Pro-
cedure: A Recursive Quick Sort; Pascal Pro-
cedure: A Nonrecursive Quick Sort; incor-
porating Sort into the Curve-Fitting Pro-
gram; SummaTy. General Leost-Squaies
Curve Fitting— In iro due tion; A Parabolic
Curve Fit; Pascal Program: Least-Squares
Curve Fit for a Parabola; Curve Fits for
Other Equations; Pascal Program: The
Matrix Approach to Curve Fitting; Pascal
Program: Adjusting the Order of the
Polynomial; Pascal Program: The Heat-
Capacity Equationi Pascal Program: The
Vapor Pressure Equation; A Three- Variable
Equation; Pascal Program: An Equation of
State for Steam; Summary. Solution of
Equations by Newton's Method— introduc-
tion; Formulating Newton's Method; Pascal
Program: A First Attempt at Newton's
Method; Pascal Programs: Solving Other
Equations; Pascal Program: The Vapor
Pressure Equation; Summary. Numerical
/Dte^/fltion— Introduction; The Definite In-
tegral; The Trapezoidal Rule; Pascal Pro-
gram: The Trapezoidal Rule with User input
for the Number of Panels; Pascal Program:
An Improved Trapezoidal Rule; Pascal Pro-
gram: Trapezoidal Rule with End Correc-
tion; Pascal Program: Simpson's Integration
Method; Pascal Program: The Simpson
Method with End Correction; The Romberg
Method; Pascal Program: integration by the
Romberg Method; Functions that Become
Infinite at One Limit; Pascal Program; Ad-
justable Panels for an Infinite Function;
Summary. Nonlinear Curve-Fitting Equa-
tions—introduction; Linearizing the Ra-
tional Function; Pascal Program: The
Clausing Factor Fitted to the Rational Func-
tion; Linearizing the Exponential Equation;
Pascal Program; An Exponential Curve Fit
for the Diffusion of Zinc in Copper; Direct
Solution of the Exponential Equation;
Pascal Program: A Nonlinearized Exponen-
tial Curve Fit; Summary. Advanced Appli-
cations: The Norma! Curve, the Gaussian
Error Function, the Gamma Function, and
the Bessel Function— introduction; The
Normal and Cumulative Distribution Func-
tions; The Gaussian Enor Function; Pascal
Program: Evaluating the Gaussian Error
Function Using Simpson's Rule; Pascal Pro-
gram: Evaluating the Gaussian Error Func-
tion Using an Infinite Series Expansion; The
Complement of the Error Function; Pascal
Program: Evaluating the Complement of
the Error Function; Pascal Program: A
Faster Implementation of the Error Func-
tion; The Gamma Function; Pascal Pro-
gram: Evaluation of the Gamma Function;
Bessel Functions; Pascal Program: Bessel
Functions of the First Kind; Pascal Program:
Bessel Functions of the Second Kind; Sum-
mary. Appendix A: Reserved Words and
Functions. Appendix B: Summary of
Pascoi— Minimum Standard Character Set;
Variable Names; Numbers; Comments;
Operations; Syntax; Conditional State-
ments; Iterative Statements; Transfer-of-
Control Statements; Input and Output;
Data Types. Bibliogiaphy. Index.
AlCftO
No, 40 - September 1981
€
APPLE DISK & MEMORY UTILITY
THE INSPECTOR
Thesp ulililies eruiblG iHic user lo examint dald
bolh in rhe Apple's memory and on disks, Simple
commanda aWow stanning rhrough RAM and
ROM memory as weW as readinB. displaying and
changing daia on djsk.
Read and tewrile accfion^ o( Random Access liJca
Reconsfrucla blown VTOC Weed ouiuntuanied
conlrol characreis m CATALOG lisMngs
UnDELETE deleted dies or programs. RL^pair (ilea
ihar have erroneous dara. All kuirhoiit being under
program conlrul and more.
You may Irdnsfer ^ecFors beiujeen disks Thii
alloujs you lo Iransfer DOS 'rom one disk to
anolhpTlberebysauingabloiAmdiskwjhenallrhar's
b[D(vn is DOS ilself; or to restore a porlion ol a
bfoivn disk (rom its backup disk
lis unifjLie NIBBLE read routine provides a Hi-Re5
grapbfcal representation of ihe data on any track
allowing you to immediately ascertain whether
your disk is 13 sector or 16 secloc. Gel an VO
error. ,is il because you have the uirortg DOS up?
is If because o( a bad address deJd'^ or a had data
(ield? or because a Irack wa^ erased'' This will
allow you to lell man mslant withoul blowing away
aDy program lii memory
• Repairs Blown Disks
• Reads Nibbks
• Maps Disk Space
• Sciirches Disks
The INSPECTOR ewn lels yuu search through
anentiredisknr through onboard memory for ]he
appearance of a siring. Now you can ifdsily add
lower case lo your pror^rams (wilh LCA).
Do you want to add so-called illegal line numbers
into your program^ or have se^wral o( the same line
numbers In a program {like the professional
programmers do)? or input unavailable commands
[like HIMEM lo Integer Basicp or pui quolalion
marks inlo PRINT siatemenls? fHere's the easy
way to do them air
AND MORE
Th^f INSPECTOR provides a USER exit ihai wilt
in"er(ace your own subroutines wiifi those dI ihe
[NSPECTOR itsi"f( For example, (usl put a
screen dump routine (sample included in
documenralion) al HEX 0300 and press CTRL Z.
The contents of the screen page will print to your
printer
ROM RESIDENT ROUTINES
The JNSPECTOR utilities come on an easily
installed EPROM Thi^ makes lliem always
available (or instant use. No need to load a disk
arid run a program.
FULLY DOCUMENTED
Unhke olher software of iis kind The
INSPECTOR comes wiih an EASY lo
understand manual and reference card. Examples
and graphics help even rhe uniniliafed use the
powero( these ulililies And Jurihetmore. we offer
Ihe kind oJ personal service which you have never
experienced from a softwai-e vendor before.
* Searches Memory
> Edits Disk Sectors
■ Outputs Screen lo Printer
• Displays Memory In HEX/ ASCII
See ^our LOCAL DEALER OR . . .
MaaiercaTdor Visa users call TOLL FREE 1-
800-8352246, Kansas residents rail 1-SOO-
.162'242L Or send S49.95. Illinois residents
add £3 sales tax.
SYSTEM REQUIREMENTS
Alf App\e n rrailijfurflEhini [lur haveaci:e« Id IniegerRa&n:
(either in ROf^ nr RAM» ^viJI ^uppnrr TTie INSPECTOR,
Jij$l place Ihe chip in errprvsockei DSeirhuionihw morher
bodrd or in ari Imtger Jimi\irare card Aivk II* syirems
with RAM expansion bturd^ or langjoge sy^iems ^||
receive thtf (NSPECTOR un disk lo mer« and load with
INTBASIC
And . il voii have an Apple II'. wiihour eii her RAM oi ROM
ac^iess to fnleg^r Ba^ic. vou ivill still tw ahle lo use THf
INSPECTOR becaurf we are malringavdilable l&kRAM
e^pan&iun boatdi al a vtiy alFordable pitze Nor only i^ill
ynu he abli! (a use The rNSPECTOR, bui yoi] wJI dl»
haLw access lo Inieaer 3iM jnd i>iher langiiiae^ 0\ir
price for BOTH rhe INSPECTOR dnd our L6k RAM
board isi I fi9.95JeB5 than mo^i RAMhoardsarone Cdll
our Dlftce for defacli.
Anoiher Quahry Product Irom
Omega So(tivare Products, Inc.
222 S. Riversidf Pbza. Chicago, IL 60606
Phone (312) 648-1944
- 1931 Omega Soflware PrndiJCls, Inc.
Apple IS a regrgrert'd Irademark of Apple Compufcr. Jnc
Your Pascal too slow?
Not anymore. ••
wirh the PASCAL SPEED-UP KR", which includes THE MILL, the easiest
woy to give your Pascal system a tremendous performance boost.
Hete Is how it worlis:
1) Plug rn THE MILL
2) l^un out configurorion ptogrom onetime
3) ThafsQil
You now hove a 30 to 000% Foster Po&cqI P-mochine, and you
don'i hove ro tecompile, teprogtom ot lelink, FOI^TRAN users moy
□Iso take odvonioge of THE PASCAL SPEED-UP KIT. Contoct yout
locol Apple deolet fot mote information,
Comrng June 1 1961 ro your local Apple deolet"
THE ASSEMBLER DEVELOPMENT KIT
STELL^TiON TWO mohes ovoiloble rhe fools necessoty ro tohe lull
odvonroge of THE MILL Eniet the world of rrue MULTIPROCESSING
with THE PASCAL SPE£C>-UP KIT and THE ASSEMBLER DEVELOPMENT
KIT ovoiloble only from STELLATtON TWO,
%
THEMILi. rtonsfoimL rhe 8-bit Apple II
into o compuref thor acts like a
i6biitnochir!e THEMILLhos
unique hortVote feotures rhor
permit tbe 6609 to run or full
speed ( 1 megohenz] ond
How rhe 6502 ronjnoi
30%ofri5noimol
speed —
ATTHE SAME TIME!
Find oof obour
THE MILL ond get
involved with the
tiotiest iterti on tfre
peisonol computer
motliettodciy.
No exi^nng personoi compurer
congiveyourf^e power
peiformonce and price olTKE MILL'S
6609-6502 combinQnon,
PO, BOX23i2-N2
SANTA BARBARA, CA 93120
(805)966-1140
Apple II
IS o trodemarl';
for Apple Compurer, Inc,
No, 40 - September 1981
MICRO- The 6502ffi809 Journal
47
T?r35»:
-.Jt-iiii--- ■
'!?_'^?.fj;T
f5f»5W^
16K RAM EXPANSION BOARD
FOR THE APPLE II* $195.00
The Andromeda I6K RAM Expansion Board
allows your Apple to use RAM memory in place
of me BASIC Language ROMs giving you up
to 64K of programmable memory. Separate
Applesoft* or Integer BASIC ROM cards are no
longer needed. Tine I6K RAM Expansion Board
works with the Microsoft Z-80 card, Visicalc,
DOS 3-3, Pascal, Fortran, Pilot, and other
software. A switch on the card selects either
the RAM language or the mainboard ROMs
when you reset your Apple.
The Andromeda 16K RAM Expansion
Board has a proven record for reliability with
thousands of satisfied customers.
Now with One Year Warranty.
•Apple N 5nd Applewrr are trademarks.
/\ronoMEDA
n ■■■" ^^"
INCORPORATED
P.O. Box 19144
Greensboro, NC. 27410
919 852-1432
DisiMbuted By:
^
COIVIPUTeR
C3ATA
SERVICES
P.O. Box 696
Amherst, NH. 03031
603 673-7375
MICRO - The 6502^6809 Journal
No. 40 - September 1981
APPLE BONUS
m
* Apple Graphics
^
This month's Apple bonus section
features a special concentration on
graphics. The versatile graphical
capabilities of the Apple lend
themselves easily to many useful and
unusual applications. These applica-
tions can range from rather ordinary
ones, like graph plotting, to some very
sophisticated uses like solid area
shading and hidden surface remova!.
In this section, the MICRO staff has
collected five graphics-oriented ar-
ticles, each of which highlights a dif-
ferent use of the Apple's graphical
capabilities.
"SHAPER," by C. Osborne, is an
easy-to-use, powerfu! utility designed
to create and maintain Applesoft
shape tables. While several shape
table utilities have appeared before,
both in the pages of MICRO and in
other magazines, none has worked
quite as quickly and easily as
SHAPER. If you have not yet explored
the possibilities offered by shape
tables, SHAPER is the perfect place to
start.
"Lo-Res Graphics and Pascal," by
CD. Heth, unlocks the power of the
Apple's low resolution graphics from
within the Pascal environment. One of
the most common complaints about
Apple Pascal has been that there are
no Lo-Res graphics instructions on
capabilities. With the routines ex-
plained in this article, the Apple
Pascal user can install these instruc-
tions and take advantage of the
16-color graphics for which the Apple
is famous. With low resolution
graphics installed, the structure and
versalilily of Apple Pascal will become
even more alluring than it already is.
"Paddle Hi-Bes Graphics." by K.
Woodward, interfaces Applesoft high
resolution graphics to the game
paddle control. Designed to enable
drawing of backgrounds on the high
resolution screen, the programs pro-
vided in this article demonstrate the
power of Interactive graphic cursor
control, and show how easily such
control is implemented on the Apple.
Additionally, the article explains some
of the graphical transformations used
in the program — transformations
which are universally essential to any
computer graphics system.
"True 3-D Images on the Apple II,"
by A, Radciiffe, illustrates how
3-dimensional views can be generated
on the Apple Hi-Res screen by the use
of stereoscopic pairs. The blue Hi-Res
"roller-coaster" depicted on this
month's cover represents one such
pair and many others can be
generated by the "noisy coaster"
routine explained in the article.
Besides providing a lucid description
of the theory and techniques underly-
ing 3-D view generation, this articie
and its accompanying programs
should provide hours of fun and
amusement. (They did for the MICRO
staff.)
"Apple Bits," by R. Vile, discusses
techniques for displaying patterns in
low resolution graphics mode. The
first part of this three-part article,
presented in this month's issue,
describes a fast, machine language
routine which converts compact,
numeric data files into tow resolution
pictures. A demonstration program,
also described, illustrates how the
routine is used to produce animation
on the Lo-Res screen. The next two
parts of the article, which will appear
in October and November, will il-
lustrate methods of generating and
using the numeric data files. Together,
the three parts of the series will enable
more effective use of the Apple's low
resolution graphics.
Each of these graphics articles
tackles a different capability of Apple
graphics. By reading through them,
and studying the program material
provided, it should be an easy matter
to unlock the hidden power of your Ap-
ple's video display.
The graphics capability is, without
doubt, one of the most powerful of the
Apple, and is certainly one of the most
interesting areas of computer science.
We hope this special section helps to
stimulate exploration of this exciting
area by all MICRO readers.
jucno
SHAPER — P. 50
Lo-Res and Pascal — P. 62
+
Paddle Hi-Res — P. 68
V:V *
3-D Images — P. 71
Apple Bits — P. 75
No. 40 - Seplember 1981
MICRO - The 6502/6809 Journal
49
I APPLE BONUS
SHAPER: A Utility
Program for iVianaging
Sliape Tables
"Shaper" describes a utility
program tor building and
managing shape tables for the
Apple II computer. The program
allows the user to build shape
tables by vector input, and view
ttie shape while It is being built.
The user can then change
shapes, add shapes, delete
shapes, review a shape table,
and save or load a shape table.
Clement D. Osborne
949 S. Kingston SI.
Aurora. Colorado 80012
Shape tables are a very valuable tool of
die Applesoft language. Programmers
are allowed to define their own shapes,
and then by implementing the Applesoft
commands DRAW, XDRAW, ROT,
SCALE, and SHLOAD, the shapes can
be drawn, erased, rotated, enlarged, and
loaded from tape. The shape tables can
be used in programs to create dynamic
effects on the high resolution graphics
screen. Animating, displaymg game ob-
jects, and mixing text and graphics on
the high resolution grapfiics screen
create only a subset of the possible uses
of shape tables. The real problem of
utilizing shape tables is the creation of
the table. This program relieves the pro-
grammer of the tedious task ot defining
the shapes and setting up the table.
SHAPER is a complete program for
building and modifying shape tables.
The first function, BUILD, allows shape
tables to be constructed. All details are
handled for creating the index portion
and shape definition portion of the table.
The user types in vector definitions by
using the keys through 7- By hitting
the ESC key the high resolution screen
will display the shape as it is being typed
in. The ADD function allows more
shapes to be added to an already existing
table. All new shape defmitions are add-
ed at the end of the table, and the in-
dexes are added in the index portion of
the table. The function CHANGE
allows the user to replace existing
shapes in a table with a new shape
definition. The actual shape definition
is added at the end of the table, the old
shape definition is removed, and the in-
dexes are updated to point to the proper
locations.
DELETE allows the user to remove
unwanted shapes from a shape table.
After the shapes are removed, the table
is compressed. The remaining shapes
will then have different numbers when
referring to them with the DRAW and
XDRAW commands. The REVIEW func-
tion displays information about a shape
table and allows the user to view the
shapes in the table. The SAVE/LOAD
function allows shape tables to be load-
ed from tape and saved or loaded to and
from disk- Creating shape tables with
SHAPER is an enjoyable process, and
using the shapes in Applesoft programs
adds a new dimension to programming
the Apple II computer.
To use the shape table in Applesoft
programs requires two steps. The first
step is loading the shape table into
memory, SHLOAD can be used to read
the table in from tape, or the code in line
7110 can be implemented to read the
table in from disk. The second step is to
store the lower two digits of the starting
location of the table in $E8 |248), and
the upper two digits in $E9 (249|.
The code presented is full of
REMarks to aid in the understanding of
how the algorithms work. Each function
is logically grouped into a set of lines.
Please contact the author if there are any
problems, suggestions, or questions
about SHAPER, The text and example
shape tables are available on cassette or
disk. Contact the author for details.
The remamder of the article is
presented in a "user's manual" format,
so it can easily be refened to while
learning to use the program. After run-
ning the program once or twice, the
user's manual will seldom be needed.
Shape tables aie a unique feature of
the Apple n. However, the method of
building shape tables described in
chapter 9 of the Applesoft manual is
time consuming, prone to error, and dif-
ficult to master, SHAPER utilizes an
automated approach which provides the
same sophisticated results in a shorter
time with less chance of error,
SHAPER not only allows the user to
build tables, but also to add shapes to
the table, change shapes in the table,
delete them from the table, display
them from a table, and save shape tables
to disk or load from disk or tape.
Executing SHAPER
SHAPER 1 is written in Applesoft
BASIC, The program takes up about
6,5K and uses HGR2, SHAPER can be
run in a 32K Apple, but 48K is recom-
mended. Once SHAPER is loaded, type
RUN to execute.
While mnning SHAPER a ' 'Yes/No"
question can be answered with any word
begmning with a "Y" or "N." If an
answer begins with any other letter,
then the question is re-asked.
An "APPLESOFT ERROR" is an
error caused by Applesoft, SHAPER
intercepts the error and prints "APPLE-
SOFT ERROR XX," where xx is the error
code as listed on page 81 of the Applesoft
Manual, To restart SHAPER hit any key.
Each cause of an " APPLESOFT ERROR' '
is discussed under the hmction in which
it can occur.
\
A "DOS ERROR xx" is an error that
occurs when a table is being saved or
loaded using the disk. The xx is the DOS |
error code as listed on page 114 of the
DOS 3-3 manual.
Warning- Do not hit "Reset" during ^
the operation of any of the hmctions of ^
SHAPER, or the table could be
destroyed.
50
MICRO - The 6502/6809 Journal
No. 40 - September 1981
APPLE BONUS
^
Selecting the Starting Location
Selecting the correct starting loca-
tion for the table is very impoitant, and
because of the importance, SHAPER
makes the user double check it. In
selecting a starting Jocation, the amount
of memory available in the computer
and the length of the shape table being
manipulated must be considered.
SHAPER 2 overwrites part of HGRl
and uses HGR2, so the logical location
for the table is immediately above
HGR2 at memory location 24576 (6000
hex). Using this location will allow a
table length of 24476 bytes without
DOS booted and 13724 bytes with DOS.
Both these lengths allow for 100 bytes of
character strings stored after HIMEM.
Question: What is the starting location
of the table (in decimal]?
Response: Action of SHAPER:
n Set n as the starting loca-
tion of the table.
Set starting location of the
table to 24576.
If n is greater than the highest
memory location in the Apple or lower
than LOMEM an "APPLESOFT
ERROR" will occur. Hit any key to
restart SHAPER, and select a different
starting location. After selecting the
starting location a menu will appear:
Fimctions available:
0. Exit from SHAPER
1. Build shape table
2. Add shapes to table
3. Change shape in table
4. Delete shapes from table
5. Review shape table
6. SAVE/LOAD shape table
Question: Function?
Response:
0-6
> 6
Action of SHAPER:
Execute the desired
function.
Re- ask question.
If a shape table is not in memory,
trying to execute the Add, Change.
Delete or Review function will give
impredictable results and usually end
with an "APPLESOFT ERROR." Each
function is described in the rest of the
article.
Build
Build is used to constroct a shape
table, SHAPER-BUILD will configure
the table in the proper format needed to
utilize the Applesoft shape table com-
mands. SHAPER-BUILD builds the in-
dex portion of the table along with the
shape definition portion.
Question: Number of shapes going into
table?
Response: Action of SHAPER-BUJLD:
Return to menu,
1 - 255 Set table for number of
shapes.
-^ 255 Re-ask question, (Maximimi
number of shapes is 255.)
SHAPER-BUILD is now ready to accept
vector definition numbers to define
shapes that are going into the table.
Definition of Vectors:
- move up
1 - move right
2 - move down
3 - move left
4 - plot and move up
5 - plot and move right
6 - plot and move down
7 - plot and move left
Question: (Will repeat until shape
definition is completed.) Vector 1 - 1 =
Response: Action of SHAPER-BUILD:
- 7 Use as vector definition in
shape,
8 - 9 Display definition of
vectors.
ESC Switch from TEXT to
HGR2 and vice versa.
X Erase last vector input.
Anyt hing else is ignored.
To end a shape definition type in
three vectors of zero. Because of how
Applesoft handles a shape definition, a
shape caimot be defined to move up
three times in a row, or move up twice
and use a plotting vector. Example (Vec-
tor n, Vector n + 1, Vector n-t- 2);
n
n+l
n-fZ
Will end the shape
definition.
[4-7]
Will end the shape
definition.
11-31
Move up twice
and move the last
vector direction.
After the shape has been defined it
will be displayed on high-resolution
graphics page two at the coordinates: X
= 139, Y = 79. These coordinates can
be changed by altering line one of
SHAPER, which also changes the point
that the REVIEW function uses.
The "ESC" key wUl switch the
display between TEXT and high-
resolution graphics page two, so the
shape can be viewed while it is being
built. If a move vector is used to go over
a point that has been plotted, the point
will disappear, but the point still exists
in the shape definition and it will be
displayed when the shape is completed,
The"X" key can be used to erase the
last vector input. The input buffer will
only hold 100 inputs. This allows for
100 vectors to be erased per shape. If
more than 100 mistakes are made on a
shape, then the shape can be ended and
restarted.
When the shape is completed, the
shape will be displayed on HGR2, and
the bell will soimd. SHAPER is waiting
for a "Y" or "N" for approval or dis-
approval of the shape. The question will
not be seen and the ESC key is inoper-
ative at this time.
Question: Is shape OK?
Response: Action of SHAPER-BUILD:
Y Allow user to define the
next shape.
N Allow the user to redefine
the last shape.
Warning: Do not start a shape definition
with or (4-7] . This will put one
byte of zero in the table to define the
shape. Applesoft will ignore this zero
and use the next bytes in the table to
define the shape until another byte of
zero is reached. Later, when using
Delete and Change functions, more
problems could arise. An "APPLESOFT
ERROR" will occur if one attempts to
build a long table past the end of
memory available in the computer.
Example of Build Function
Suppose one wishes to build a shape
table of one shape. The shape looks like
a "Y" in a 5 X 7 format. For starting
location reply; (sets starting location
to 24576 — 6000 hex). The shape looks
like this:
•
•
•
No. 40 -September 1981
MICRO - The 6502/6809 Journal
51
APPLE BONUS
The shape is then drawn with direction
vectors:
The vectors would be laid out as shown
in figure 1, Type in the vector definition
numbers followed by three zeros. Loca-
tion 6000 hex will show the table as in
figure 2.
Add
Add allows one to add shapes at the
end of an already existing shape table.
The number of shapes added cannot
make the total shape count in the table
go over 255.
Question: Ntmiber of shapes adding to
table?
Response: Action of SHAPER-ADD:
Return to menu,
1 - n Allow n number of shapes
to be added to the table.
NS+n>255 Re-ask question,
[n is the number of shapes adding. NS is
the number of shapes in table. NS + n is
the number of shapes in the table after
the add. }
After telling SHAPER-ADD how
many shapes are being added, the vector
definitions are typed in as in SHAPER-
BUILD.
Change
Change allows a shape definition to
be redefined. The new shape is defined
as in SHAPER-BUILD and it replaces the
one being changed.
Question; Shape to be changed!
Response; Action of SHAFER-CHANGE:
Return to menu.
1 - NS The requested numbered
shape is changed.
> NS Re-ask question.
(NS is the number of shapes in the
table.)
After telling SHAPER-CHANGE what
shape is to be changed, the vector defini-
tions are typed in as in SHAPER-BUTLD.
Figure 2
6000 ,01, no ,04 oq ^zk ^c 38 20 to 31 17
Number of Index Shape Definition
Shapes In
Table
06 OOi
t
Ewi Byte
Delete
Delete allows unwanted shapes to be
removed from the table. SHAPER-
DELETE removes the shape definition,
removes the index, and compresses the
table. This compression causes all
shapes after the deleted shape to have a
smaller definition number in the table.
Example: Suppose shape number 3 is to
be deleted.
Befoie
Shape Number
Shape
1
2
3
4
5
A
B
C
D
E
After
Shape Number
Shape
1
2
3
4
A
B
D
E
Notice after shape 3 is deleted, that
shape 3 now defines D, and shape 4 is
now E.
Question: (Will repeat until function is
completed.] Shape to be deleted?
Response; Action of SHAPER-DELETE:
Return to menu if no shapes
have been deleted. Com-
press table and return to
menu if shapes have been
deleted,
1 - NS Delete that shape from the
table.
>NS Give error message and re-
ask question.
PS Give eiroi message and re-
ask question.
(NS is number of shapes in the table.]
|PS is a previous deleted shape in this
execution of SHAPER-DELETE- )
Many shapes may be deleted in one
execution of SHAPER-DELETE, The
table is not compressed until is typed
to end the function. So, in the above ex-
ample if shape 2 and shape 4 were to be
deleted, then 2, 4, and would be typed
in to answer the questions. B and D
would be deleted.
If there is only one shape in the
table, the Delete function cannot be
used. Trying this will result in an error
message and the question being re-
asked. Type in zero to exit from
SHAPER-DELETE-
Depending on the size of the table,
there will be a delay when typing in zero
to end the function. This is when the
table is being compressed.
Review
Review will give information about
the table and allow the shape table to be
displayed. Information given: 1. The
starting location of the table; 2. The
ending location of the table; 3. The
length of the table; 4. How many shapes
are in the table.
Question; Shape number (first, last)?
Response; Action of SHAPER-REVIEW:
,L Retum to menu.
F,L iF = L] Display shape,
F,L (F<L) Display shape F through
shape L.
E,L (F>L| Re-ask question.
(F is the first shape to be displayed,)
(L is the last shape to be displayed.)
If L is greater than the number of shapes
in the table then the shapes from F to
the end of the table will be displayed.
If an "APPLESOFT ERROR" occurs
when the function is being executed for
the first time, then a table does not exist
at the given starting location. Insme
there was a table at the starting location.
52
MICRO - The 6502/6809 JournaL
No. 40 - September 1981
APPLE BONUS [
If the table was read in from tape, make
sure there was not an I/O error during
the read, and that the length of the table
was correct.
The point that the shape is drawn at
is: X = 139, Y = 79. This point can be
chariged by altering line one in the pro-
gram. Altering the coordinates also
changes them for the Build function.
While a series of shapes is being
displayed, a zero can be typed in to exit
the function.
Save /Load
Save/ Load allows a shape table to be
loaded from cassette tape, loaded from
disk, or saved to disk. A function menu
will appear:
0. Exit
1. Load from tape
2. Save to disk
3. Load from disk
4. List catalog
Question: Function?
Response:
1
2,3
4
Action of SHAPER-
S AVE/ LOAD:
Return to menu.
(See cassette fuoction
below.)
(See disk function below,]
Display Catalog from the
disk.
Cassette Tape:
Question.- How long is table (in decimal)?
Response: Action of SHAPER:
(Load from tape)
Return to menu.
n Use as length of table.
Next, the tape should be started. Hit any
key to start SHLOAD command, which
reads the tape.
If the wrong length is given, then the
table will not be loaded at the starting
location given. This will cause an
"APPLESOFT ERROR" later in the ex-
ecution of another function. Reload the
table using the correct length.
If "ERR" appears on the screen, then
an I/O error has occurred during the
read. An "APPLESOFT ERROR" will
occur. Hit any key to restart the pro-
gram. Check the tape and recorder for
problems.
Disk;
Question: What is the (input /output)
file name?
Response.- Action of SHAPER (Disk):
Legal File Perform the save or load
Name function.
An illegal file name as defined in the
DOS manual will result in a "DOS ER-
ROR" or an "APPLESOFT ERROR." A
"DOS ERROR" will return to the
Save/Load menu and the function can
be retried. An "/APPLESOFT ERROR"
will return to the beginning of the pro-
gram. The sWpe table is not lost. Use
the same starting location and the table
is recovered.
SHAPER Listing
DIM BFXdOO)
1 X = i3'?5y = vf
10 IDNERR emo 9O00
14
REM
15
REM
It
REM
18
REM
l"?
REM
COMMENTS 5HDUL0 NOT
BE INCLUDED IN THE
EXECLITABUe MODULE.
SET CONSTftlMia
20 XI = XiYl = y:TW - 2:aE = I ! TF
= 256: ZE = 0:TR = 3: GOTO &
000
lOdO KB = BFy. <B3);B~ = B3 -* OE:
B3 = 101 THEN B3 = 2E
IF Bl = TW THEN RETURN
60SUB 1030: RETURN
REM : » SUBROUTINE FOR *
REM ! K VECTOR INPUT «
1030 N = N + OE
1040 PRINT "VECTOR
IF
1010
1020
1027
102B
'■;SNi"-"!N;"
1049 REM : GET KEYBOARD INPUT
AND DETERMINE ACTION
HCOLOR= TR: HPLOT Xl,YliKI =■
PEEK ( - lt3S4) - 176: HCDLDR=
ZE: HPLOT Xl.Yll IF (KI < ZE
AND KI < > - 21) OR (KI >
9 AND KI < > 40) GOTO 1050
POKE - 1636B,ZE! IF KI = 4
O GOTO 1190
IF KI - - 21 GOTO 1170
IF KI > 7 GOTO 1330
PRINT KIi IF KI > TR
THEN HCDLDR= TR: HPLDT Xl.Yl
1050
1060
1070
1 080
1O90
1099 REM : PLOT NEW VECTOR POINT
1100 T6 = KI:B4 = OE: GDSUB 1240
1110 BF7.(BP> = KIiBP = BP + DE: IF
KI = ZE THEN B2 = B2 + OE
1120
IF B2
= TR OR (KI :-
TR AND
B2 = TW) THEN Bl = TW: RETURN
1130
IF BP
= 100 THEN Bl
= OE
1140
IF BP
= lOl THEN BF
= ZE
1150
IF KI
< > ze THEN
B2 = ZE
1160
RETURh
1169
REM :
SWITCH SCREEN
MODE
1170
IF S =
DE THEN POKE - 162 |
99, ZE:
POKE - 16297
,ZE: POKE
- 16304, ZE:B = ZEi
GOTO 103
IIBO
TEXT :
S = OE: GOTO
1050
1189
REM :
ERASE OLD VECTOR 1
1190
BP = BP - OE: IF BP
= B3 -
E OR N
- OE GOTO 1230 |
1200
IF BP
< ZE THEN BP
= 100
1210
T6 = BF7.(EiP) :&4 = -
DE: S05UB
1240
1220
HPLOT
XI. Y1:N = N -
DE: PRINT
"ERASED": GOTO 1040
1 230
BP = BP * DE: PRINT
"CAN'T E
RASE":
GOTO 1040
1237
REM :
SET UP NEW X
AND V
VALUES
FOR PLOTTING
1240
IF T6
= ZE OR T6 -
4 THEN V
1 = Yl
- B4
1250
IF T6
= DE DR T6 =
5 THEN X
I = XI
+ B4
1260
IF T6
= TW OR T6 =
6 THEN V
1 = Yl
+ 64
1270
IF T6
- TR OR T6 =
7 THEN X
1 = KI
- 64
1200
IF XI
< ZE THEN XI
= 279 1
1290
IF XI
> 279 THEN XI = ZE |
1300
IF Yl
< ZE THEN ¥1
= 191
1310
IF Yl
' 191 THEN Y
= ZE
1320
RETURN
1329
REM
PRINT VECTOR 1
DEFINITIONS
1330
PRINT
! PRINT "0 !
MOVE UP
4 : PLOT & MOVE UP": PRINT I
fContinaed)
No, -10 -September 1981
MICRO - The 6502'6809 Journal
53
■ APPLE BONUS
"1 J MOVE RIGHT 5 : PLOT
!. MOVE RIBHT": PRINT "2 : MO
VE DOWN 6 : PLOT !, MOVE
DOWN": PRINT "3 : MOVE LEFT
7 : PLOT !. MOVE LEFT";: GOTO
REM : « BUILD ROUTINE *
PRINT "«# BUILD **": PRINT
: INPUT "NUMBER OF SHAPES GO
ING INTO TABLE '' ■';NS; IF NS
', DE GOTO 6050
IF NS > = TF GOTO 1340
REM ! SET UP BEGINNING OF
SHAPE TABLE
VTflB 24: POKE PP,NS:PP = PP
4- OE: POKE PPjZEiPP = PP +
QEsSS = NS * TW + TW + SLiR -
ZE
REM 1 SET UP INDEXES INTO
TABLE
1370 T2 = INT ( (SS - SL) / TF> iT
1 = INT <SS - SL - T2 « TF)
1050
133B
:340
1350
1357
1360
1367
13fl0
1370
140O
140B
1407
1410
1417
1420
1430
1437
1440
1447
1450
1460
PP = SN * TW + SLi POKE PP,T
UPP . PP + oEi POKE PP, T2fP
P a SS
VTAB 24iBP = ZE:B3 ■= ZElBl =
ZE
IF BI = ZE THEN GOSUB 1030
! GOTO 1400
REM 1 ALL SHAPES ARE BUILT
AFTER RECEIVING 3 VECTORS
REM : GET 1 OF 3 VECTOR
SOSUB lOOOiTl = KB
REM : GET 2 OF 3 VECTOR
GOSUB 1000: T2 -^ KB
PE = Tl + T2 * a
REM ! GET 3 OF 3 VECTOR
GOSUB 1000! IF PE = ZE AND
TR OR KB = ZE) GOTO 15
(KB
lO
REM ! CONVERT VECTORS FOR
EACH BYTE IN THE TABLE
Tl = KBi IF KB > TR GOTO 147
O
PE = PE + KS * 64: POKE PP,P
E:PP = PP + DEi IF Tl = ZE AND.
T2 = ZE GOTO 1430
3470 IF Tl = ZE GOTO 1420
1480 GOTO 1410
1470 POKE PP,PE!PP = PP * OE: IF
T2
ZE THEN T2
TliTl = ZE
1500
1507
1510
1520
1530
1540
1550
1560
1570
15S0
1590
179B
2000
J GOTO 1430
GOTO 1420
REM ! REVIEW THE SHAPE
POKE PP.ZEjPP = PP + OE:N ■=
ZE: HSR2 :S = ZE: HCOLOR= TR
: ROT= ZE: SCALE= DE: DRAW S
N AT X,¥
BP = ZEiB3 = ZE:B1 = ZEiXl =
X:V1 = V!B2 = ZE
VTAB 24: INPUT "IS SHAPE OK
? "jAtt IF LEFT* <A«,OE> =
"V" GOTO 1560
IF LEFT* <A*,DE1 < > "N" GOTO
1530
CALL 62450:N = ZE:PP = SSl 6DT0
1400
IF SN = NS SOTO 15B0
CALL 624501 PRINT : SS = PP:
SN = SN * DE: SOTO 1370
IF R < > ZE THEN TEXT : PRINT
"»* TABLE IS BEING CHANGED »
*": GOTO 30BO
GOTO 6050
REM ! t ADD ROUTINE *
PRINT "«« ADD «*": PRINT
2010 INPUT "NUMBER OF SHAPES ADD
ING TO TABLE ? ";ND! IF ND <
OE GOTO 6050
2020
2030
2037
2040
NS = PEEK (SL):SN = NS + ND
! IF SN > 255 GOTO 2010
POKE SL,SN!PP - SL
REM : RECOMPUTE INDEXES AND
MAKE ROOM FOR NEW INDEXES
FOR I = OE TO NS:PP = PP +
TW:T1 = PEEK fPP) * PEEK (
PP -f 0E> * TF:T2 = Tl + ND t
TW!T3 - INT (T2 / TF>|T2 =■
INT (T2 - T3 « TF) ! POKE PP
,T2: POKE PP ♦ 0E,T3! NEXT
2050
2060
2070
2OS0
2009
2090
EF
T2
- PP
= T2
TWiT2 =
OE: IF
Tl
PEEK
SL
(T2)
> ZE GOTO 206O
PP
OE
= T2 t ND * TWlSS
PP
T2 -
POKE PP, PEEK (T2)!T2
OE:PP = PP - OE: IF T2 > =
EF GOTO 2080
REM : SET UP VARIABLES FOR
TRANSFER TD BUILD
SN - NS + DE:NS = PEEK (SL>
: GOTO 1370
2998 REM : « CHANGE ROUTINE «
3000 PRINT "«« CHANGE *«": PRINT
:NS = PEEK <SL):T1 = NS * T
U + SL:PP = PEEK <T1) + PEEK
(Tl + OE) * TF + SL
3010 INPUT "SHAPE TO BE CHANGED
? "iND: IF ND < OE GOTO 6050
3020
3027
3030
3040
3047
3050
3060
3067
3070
3077
30B0
3090
3100
3110
3120
3130
3 1 40
3150
3160
IF ND > NS GOTO 3010
REM : REPLACE THE LAST
SHAPE IN THE TABLE
IF ND = NS THEN R = ZE: GOTO
3070
PP = PP J- OE: IF ND - NS THEN
R = ZE: GOTO 3070
REM : AN INTERNAL SHAPE IS
BEING CHANGED
PP = PP + OE: IF PEEK (PP) <
> ZE GOTO 3050
PP = PP + OE:T2 - ND * TW +
SL:T3 = PEEK (T2) + PEEK <
T2 + OE) « TF[T4 = PEEK (T2
+ TW> + PEEK (T2 + TR> * T
F:T5 - T4 - T3:SS = PP - SL:
SN = INT (SS / TF>:SS - INT
fSS - SN * TF) : POKE T2,SS: POKE
T2 + OE,SN:EF = PP:R = OE
REM : INITIALIZE VARIABLES
SO BUILD CAN CREATE SHAPE
SS = PPsSN = NDsNS = SN: GOTO
I370
REM : REMOVE OLD SHAPE AND
ADJUST INDEXES
R - ZEiTl - PP - £F:T5 = Tl -
T5:SN = INT (T3 / TF):SS =
INT (T3 - SN * TF):NS = ND t
TW + SL: POKE NS,SS: POKE NS
* OE.SN: IF T5 > ZE GOTO 31
10
IF T5 = ZE BOTO 3130
T2 = PP - OE:PE = T4 + SL -
OE:PP = T4 * SL + T5 - OE:SS
= OE: GOTO 3120
PE = PP:PP = PP t T5:SS = -
DE!T2 - T4 + SL
PE = PE ■>■ SS:PP =
PP +
IF PE <
SS: POKE
> T2
PP, PEEK (PEI:
GOTO 3120
PE = EF + T5:PP = SL + T3:T!
= PP + Tl
POKE PP, PEEK (PE):PP = PP +
OE:PE = PE -1- DE: IF PP < Tl GOTO
3140
PP = NS:EF = PEEK
+ PEEK (SL + TR)
PP = PP + T«!T2 =
+ PEEK (PP + OE)
(SL + TW)
« TF + SL - TW
PEEK (PP)
* TF:T2 =
(Continued)
54
MICRO - The 6502/6809 Journal
No. 40 - September 1981
APPLE BONUS
3170
399S
4000
10 10
4019
4020
4030
4040
4049
4050
T2 + T5:T1 - INT (T2 / TF) !
T2 - INT (T2 - Tl « TF) : POKE
PP,T2: PDKE PP + OE.Tl: IF P
P < > EF EDTD 3160
GOTO t05O
REM i # DELETE ROUTINE »
PRINT "*« DELETE «*": PRINT
:EF = PEEK ?SL>:Pe = EF * T
W + BLjPE = PEEK (PE) + PEEK
<PE + OE) » TF + SL:NS = EF
INPUT "SHAPE TO BE DELETED
■? ";ND: IF ND ■: = IE THEN PRINT
■'«« TABLE IS BEING COMPRESSE
D »S": BOTO 40B0
REM ! ERROR CHECK SO TABLE
WONT BE DESTROYED
IF (ND > EF) OR ND < ZE GOTO 422
IF NS = OE GOTO 4220
SN = SL + ND * TWiPP = PEEK
(SN) + PEE^- (SN + DE) » TF +
SL: IF PEEK (SN) - ZE GOTO 4220
REM : ZERO INDEX TO SHAPE
POKE SN.ZE: POKE SN + DE, ZE
4Ofa0 IF PEEK (PPl = ZE GOTO 4210
4069 REM ; ZERO SHAPE DEFINITION
4070
4080
4oas
4089
4090
4100
4110
4120
4130
4140
4150
4160
4170
41B0
4190
4200
POKE PP.ZEiPP = PP t OE: GOTO 4^,^^,
Tl = PEsPP = NS * TW + BL +
TW:PE = SL + EF * TW + OE
REM ! COMPRESS ZEROS OUT OF TABLE
REM : LEAVE A SINGLE BVTE
OF ZEROS BETWEEN SHAPES
Tl = Tl + OE: IF PEEK <T1) <
■> ZE GOTO 4090
PE = PE + OE: IF PEEK (PE) =
ZE GOTO 4100
POKE PP. PEEK (PE):PP = PP +
aE:PE = PE + OE: IF PEEK (P
E) < > ZE GOTO 4110
IF PE = Tl GOTO 4170
IF PEEK IPE + OE) < - ZE GOTO
4110
POKE PP, PEEK (PE)iPP = PP +
OE
PE = PE + DEs IF PEEK (PE) =
ZE GOTO 4150
IF PE < Tl GOTO 4110
POKE PP.ZE: POKE SL,NSiEF -
ZEsPP - SL + TWiT2 - ZE:r3 =
NS * TW * TWjTl - T3 + SL
T4 = T3 + T2iT5 = INT (T4 /
TF):T4 = INT (T4 - T5 * TF)
1 POKE PP,T4! POKE PP + OE,T
5:PP = PP + TW:EF = EF + OE:
]F EF - NS GOTO 6050
Tl = Tl * 0E!T2 =^ T2 + OE: IF
PEEK (Tl> < > ZE GOTO 4190
Tl = Tl + OE:T2 - T2 + OE: GOTO 4160
4210 PRINT "SHAPE DELETED": PRINT
:NS = NS - OE: GOTO 4010
4220 PRINT "«* ERROR «« INVALID
SHAPE NUMBER": PRINT : GOTO 4010
4998 REM : * DISPLAY ROUTINE «
50O0 NS - PEEK (SL):T1 = NS * TW
+ SL:T2 = PEEK (Tl + OE)iT
1 = PEEK <T1):T1 = T2 « TF +
Tl + SL
5009 REM : FIND THE END OF THE
TABLE
5010 Tl = Tl + OEi IF PEEK (Tl> <
> ZE GOTO 5010
501? REM : COMPUTE ENDING ADDRS
(Tl), AND LENGTH (T2)
5020 Tl = Tl + DE:T2 - Tl - SL
5030 HOME : TEXT : VTAB TR: PRINT
5040
5050
5060
5070
5079
5OS0
50B9
5090
5100
5110
5997
5996
5999
6000
****» SHAPE TABLE REVl
EW »»*»*": PRINT : PRINT "
TABLE STARTING LOCATION -> "
jSLi" DECIMAL": PRINT 1 PRINT
"TABLE ENDING LOCATION >
"jTIi ■■ DECIMAL"
PRINT : PRINT "LENGTH OF T
ABLE > "iT2;" BYTES"
! PRINT ! PRINT ! PRINT "NUM
BER OF SHAPES IN TABLE- i ";N
S
VTAB 22: INPUT "SHAPE NUMEE
R5 (FIRST, LAST) ? ";BN,r5: IF
SN : NS QR SN f T5 GOTO S050
IF SN = O GOTO 6050
IF T5 ■■ NS THEN T5 = NS
REM : DRAW SHAPE (I) FROM
THE TABLE
FDR I = SN TO T5: HGR2 i5 =
ZE: COLOR= TR: SCALE= OE: ROT=
HE: DRAW I AT X,V: VTAB 23: PRINT
"SHAPE NUMBER "i I
REM : CHECK FOR "0" TO OUI j
FOR T4 = DE TO 150: IF PEEK
( - 16384) = i76 GOTO 5110
NEXT ! NEXT
- 1636B,ZE:S = OE: GOTO
POKE
5030
REM
REM
REM
« MAIN PROGRflM «
B = OE: HGR2 : HOME : TEXT :
VTAB 2: PRINT "***»******
S H A P E R 2 «»««»«»««*«
": VTAB 3: PRINT TAE< 2)i"»
"! TAB( 39)("«"i PRINT TAB<
3>i"«") TAB( 38)1"*": PRINT
TAB( 4)("»"i TAB( 12) ; "A UT
ILITV PROGRAM"; TAB! 37) 1"*"
6010 PRINT TAB( 5) !"«'*! TAB ( 14
)t"FOR MANAGING"! TAB< 36)1"
«"! PRINT TflElt 4)t"*"| TAB(
14)! "SHAPE TABLES"! TAB ( 37)
;"«"! PRINT TAB( 3))"«"| TAB (
38)i"«": PRINT TAB ( 2)!"»"(
" COPYRIGHT 1980 CLEMENT D.
OSBORNE"; TAB ( 39))"*"
6O20 FOR I - OE TO 40l VTAB lOi HTAB
I: PRINT "t": NEXT
602S REM : GET STARTING LOCATION
AND POKE FOR DRAW COMMANDS
6029 REM : GET STARTING LOCATION
6030 PRINT : PRINT "WHAT IS STAR
TING LOCATION": INPUT "OF TH
E TABLE (IN DECIMAL) "^ "(SLi
PRINT : PRINT "DOUBLE CHECK
STARTING LOCATION ■ " : PRINT
: INPUT "IS n CORRECT '> "iA
a: IF LEFTS (A4,0E) : ■ "Y
" GOTO 6030
6035 IF BL = O THEN SL = 24576
6040 PP = INT <5L / TF)i POKE 23
3.PP:PP = INT (SL - PP * TF
) : POKE 232, PP
6049 REM : NAIN MENU
6050 TEXT : HOME : VTAB 3: PRINT
■FUNCTIONS AVAILABLE: ■': PRINT
: PRINT " O. EXIT FROM SHAP
ER": PRINT : PRINT '■ 1, BUI
LD SHAPE TABLE": PRINT : PRINT
" 2. ADD SHAPES TO TABLE":' PRINT
: PRINT " 3. CHANGE SHAPE 1
N TABLE"
6060 PRINT : PRINT " 4. DELETE
SHAPES FROM TABLE": PRINT : PRINT
" 5. REVIEW SHAPE TABLE": PRINT
: PRINT " 6. SAVE/LOAD SHOP
E TABLE": PRINT ! VTAB 20: INPUT
IContinuedj
No. 40 - September 1981
MICRO - The 6502/6809 Journal
55
r
APPLE BONUS
6070
AV97
6999
70O0
"FUNCTION ? "jTll IF Tl < ZE
OR Tl > h GOTO 6050
CALL 62A50:PP = SLiSN = OEi
HOME : QN Tl GOTO 1340,2000
,3000,4000,5000,7000: GOTO 9
999
REM : *»»*IHHf**»Mt.**.»*tt.**
REM : » I/O ROUTINE *
REM : «llt««X»««t>t«t«*«»t:(
VTflB 2: PRINT "«« SflVE/LDfl
D «*■': PRINT 1 PRINT " O. E
XIT": PRINT i PRINT " 1. LOfl
D FROM TftPE"! PRINT c PRINT
" 2, SAVE TO DISK": PRINT i PRINT
" 3. LOAD FROM DISK": PRINT
7010 PRINT
4. LIST CATALDB": PRINT
IS
'sTl
PEEK
7020 D4« = CHR« (4»t INPUT " FUN
CTIDN ? ■■,72: IF T2 < ZE OR
T2 > 4 SOTO 7000
7030 HOME : ON T2 GOTO 7040,7060
,7100,7120: GOTO 605O
7040 PRINT : INPUT '■HOW LONG
THE TABLE (IN DECIMAL) "
: IF Tl = ZE GOTO 60S0:
7O50 T3 - PEEK (116) « TF +
(115): HIMEMi Tl t SL + OE: PRINT
: PRINT ■'START TOPE, WHEN RE
ADV HIT ANY KEV": GET A*! SHLOAD
: PRINT : INPUT "HIT RETURN
TO RETURN TO MENU^'jAa: HIMEM:
13: GOTO t050
7060 PRINT 1 PRINT "WHAT IS THE
OUTPUT FILE NAME ? ": INPUT
fl«:Tl = PEEK (SL) « TW + BL
:T2 = PEEK (Tl + 0E):T1 = PEEK
(Tl) tTl = T2 » TF -1- Ti + SL
7070 Tl - Tl + GE: IF PEEK (Tl> <
> ZE GOTO 7070
7OB0 T2 - Tl + OE - SL
7090 PRINT D4t;"BSAVE "!««;■', A";
SL;",L"iT2: PRINT t PRINT A*
! PRINT " HAS BEEN WRITTEN
TO DISK": PRINT : PRINT "STA
RTING LOCATION ! ";SL."LENGT
H J ";T2i GOTO 7140
7300 PRINT ! PRINT "WHAT IS THE
INPUT FILE NAME 7": INPUT A»
7110 PRINT D4«i ■'BLDAD ";A*i'^,fl"i
SL: PRINT 1 PRINT A»: PRINT
" HAS BEEN LOADED AT ''iSL: BOTO
7140
7120 HOHE : PRINT D4»; '■CftTALOG"l
PRINT D4*
7130 PRINT : PRINT ■HIT ANV KEV
TO CONTINUE": GET A*: HOME :
GOTO 7O00
7140 PRINT : PRINT "HIT ANV KEV
TO CONTINUE": GET A«! GOTO 6
050
899B REM : » ERROR ROUTINES «
9000 IF PEEK (222) = 254 THEN RESUME
9005 IF PEEK (222) > O AND PEEK
(222) < 16 GOTO 9040
9010 PRINT : PRINT '■«* APPLESOFT
ERROR »« "; PEEK (222): PRINT
: PRINT "HIT ANV KEV TO CONT
INUE'^: GET AS: GOTO !
9040 PRINT : PRINT "»» DOS ERROR
«* "i PEEK (222): GOTO 7130
9999 END
juno
DROWNING IN PAPERWORK?
The MAGIC WINDOW worcJ processing system lets you breath easier.
MAGIC WINDOW is the professional tool that will (essen the efforts of communication and improve your productivity!
Secretaries al APPLE, Engineers, writers of leading computer magazines and U.S. government officials have
selected and use MAGIC WINDOW over all the other
word processors available for the APPLE II compute^
MAGIC WINDOW'S overwhelming appeal amonc
experts and novice computer users originates^
simulation of a standard typewriter. Add thr
of disk file storage, four way scrolling provie
of 80 column documents, logically placed a
learn single key editing commands, and you'
processor that is truly magical.
Take a relaxing deep breath and ask your Ioce
computer store for MAGIC WINDOW.
ANNOUNCING BASIC MAIL
BASIC MAILER is a mailing list merge system „
to take MAGIC WINDOW document files and re
names, addresses or any other section of the doc_..
individual data, creating customized letters, invoic„
etc. BASIC MAILER uses the same human engineere
systems used by MAGIC WINDOW.
Together MAGIC WINDOW and BASIC MAILER
create an affordable, powerful and professional
word processing mailing system. The uses for either of these
systems are almost unlimited.
10432 Burbank Boulevard • North Hollywood, California 91601 • (213)985 5763
56
MICRO - The 6502/6809 Journal
No. 40 - September 1 981
APPLE BONUS
T,M,
SENSIBLE SOFTWARE, INC. is pleased to introduce...
' f t'Wary OUR 1981 COLLECTION OF SUPERIOR SOFTWARE FOR THE APPLE COMPUTER. . .
APPLESOFT-PLUB STflUCTUnEO BASIC [API_US] SeS.OO
32K + , Disk M, ROM/RAM A|)pleso(I, Apple ll/Apple II +
APLUS is a 4K machine language ulilily Ihal adds Ihe lollowing slruclufEd progtammlng commands to Applesotl basic: 1] WHEN.. ELSE .FIN, 2) UNTIL, 3)
WHILE. 4) UNLESS, 5] CASE, 6) SELECT (variable), and 7) (OTHERWISE). Mulli-line IF. THEN slatemenis are also supponed, APLUS allows Ihe use ol
■■(lamed" suOfoulines or "pfocedures". The programmer can now Insirucl a program to ■■□0 CURVE-FIT" without worrying aDoul Ihe location ol Ihe
subfouline APLUS automatically indenis ■SLIST"ed programs to claril^ the logic flow. THe APLUS "&CONVEHT'^ command replaces the above slructured
programming commands witli ■■GOTO'"s ard "GOSUa'"s to provide a standard Applesoft program as output. New programs can now be written using
"GOTO "less logic.
APPLESOFT PROGRAM OPTIMIZER (AOPT) SSO.OO
32 + . Disl( II, ROM/RAM APPLESOFT. Apple ll/Apple II +
AOPT IS a Z.2K machine language utility that will substantially reduce (he size ol an Applesoft program without allecHng Ihe operation ol the program. AOPT
aulomaticaily: t ) Shortens variablE names. I) Removes remarks. 3| Removes unrelerenced lines. 4] Appends short lines together. 5) Removes e«tra colons,
and 61 Renumbers line numbers, AOPT will convert a verbose, well documented, developmeni version of a program into a memory-ell icient, more secure, pro-
duction version ol the same program This is the ORIGINAL and the BEST optimizer on Ihe sottware market today!
DOS PLUS SS5.00
32 + . Disk II, DOS 3.3. Apple ll/Apple 11 +
DOS PLUS is the sottware solution lor living with both 13-sector(DOS 3, i, 3.2. and 3 2.1 ) and 16 sector (DOS 3. 3| Apple diskettes. DOS PLUS adds 8 new
commands 10 Apple DOS. Three of these are built-in and five are user delinaDle. The built in commands include: 1) ".F" to "flip" between DOS 3 2 and 3 3
(The user need not reboot and any program that resides in memory will not he affected by the flip. The DOS version can even be changed within a programi), 2|
■ S' status command informs you what DOS version is currently active, and 3) ■ B'^ BLOAD- analysis is also provided to inform Ihe user of tbe starting ad-
dress and lengffi of the last accessed binary trie. DOS PLUS also includes a DOS COMMAND CHANGER program to allow easy customization of Apple DOS com-
mands to suit individual tastes.
□ISKOROANIZERII — NEW — $30.00
ASK. Disk II. Apple It/Apple It -i-
DO it is the fastest and Ifiendliest utility available today for organizing tiles on an Apple II diskette DO II provides the following tunctions: 1) TITLING In Nor-
mal, Inverse, Flashing,. Lower case, and other characters normally not available, 2) CUSTONl REORDERING of ffie directory. 3) ALPHABETIZING, 4) DVNAUIC
DISPLAV ol ALL filenames On a diskette (including deleted files), 5) RENAMING hies wilfi the same character options as TITLING, 6| UNDELETING, 7]
DELETING, B) PURGING deleted tiles, 9) LOCKING [all or somel, 10) UNLOCKING (all or some), 11) USE of DOS sectors for increased data storage, and 12) a
SIMULATED CATALOG to show the modilied directory bafore it IS written to the diskette. DO it is completely MENU DRIVEN and attains it's speed by altering a
RAM version of the catalog DO II usesa very powerful SI^ART KEY to automatical I y locate the neni valid filename for any specitied disk operation Compatible
with DOS 3.1 , 3.2. 3.2.1 , and 3.3 as well as lilUSE DOS to allow manipulation of SUPER TEXT tiles! (Note: Updates available lor S5.00and original disketle.)
PASCAL LOWER CASE — NEW — SaS.OO
J8K + . Disk II, Apple ll/Apple II -i- , Language System
Tills IS Itie most recent commercially available LOWER CASE MOD tor Pascal for the Apple It. It is the only currently available modification that is compatible
with both versions of Pascal (1 Oand i.l). The Pascal version is automalically checked prior to updating system Apple. II you have any ol the hardware lower
case adapters you can now input ttie following characters directly from the keyboard. | - ^ <, J _. and \ , This modification does NOT interfere
wilh any of Ihe -Control' character functions implemented by the Pascal environment and will 'undo' any alterations made by other commercially released
modilications
QUICKLOADER SES.OO
48K-1- , DisK II, Apple ll/Apple II i . (2 Disks)
If you lind yourself doing the same ihings over and over - OL will help you do it taster! QL is a unique disk that lets you load DOS, a language card |optionally),
and an application program ol your choice enlremely rapidly. OL boots as a i3 or 16 seclor diskelle and is easy to sel up and use To change Ihe setup, you
merely load your Apple RAM with Ihe new data and use the ■RECONFIGURE' ' opiion ol OL. The nesi time you boot your OL disk, it will quickly toad your new
setup (Language Card DOS, Application program) into your Apple! QL can reduce the time to pertorm these functions by up to 80%! Now thai you've read
this, you say ■■But I can already Oo all of that!" QL doesn't do anything new- it just does it MORE CONVENIENTLY and FASTER! T17 it, you'll like it 1
OISK RECOVERY ["THE SCANNER"] S3Q.OO
48K+. Disk It. Apple ll/Apple 11 -t-
This program is long overdue. You need no longer be concerned with the problem of physically damaged disks. Just as "Apple Pascal" provides a ■■BAD
BLOCK SCAN", DISK RECOVERY will do a complete scan Ol your Apple diskettes' recording surface. Damaged areas will be "marked" as used in the disk
directory so that no attempts will be made to "WRITE " to a bad sector. The VTOC will be completely redone to reflect both the Dad sectors and actual disk
usage A complete report is generated advising the user of all corrections. A resullrng "DISK MAP^' Is presented lor your review. The greates! advantage of
this program over the other versions is that it can be used on either NEWLY INITIALIZED DISKS or disks that ALREADY CONTAIN PROGRAMS as well as the
SPEED of analysis. THE SCANNER is fully compalible with bolh 13 am] 16 sector diskettes. This is a must tor all Disk II owners!
ALSO AVAILABLE: SENSIBLE SOFTWARE, INC.
SUPER DISK COPY III aSO.DQ 6B19 PERHAM DRIVE / W. BIOOI^FIELD, MICHIGAN 48033
MULTI-DISK GATALOaiii"."//™".".. 920.00 313 399 8B77
THE NEW pnOTECTOR SSSO.OO „.cTcor«nn uuci rnui:
(Call or w.ik 10- inio,™ii™i VISA aild MASTERCARD WELCOME
I I IM&B LAKinEB II S1B.OO Michigji. Residents ada l-i SaISS la.
■.i^ivj-ti-i t-ri.t-mt^m-w-' — pieJSB aoo (I M posl^oB », lisntlfcnc loieach itmoroeieil.
MASTER MAZE S1B.OO
No. 40 -September 1981
MICRO - The 6502/6809 Journal
57
APPLE BONUS
UersaLUriiBr
PLAN AH
fiBCDEFGMI jrLnnDPOB
ABraEZHeiKAMN^OTI
^^ IB, I? ^ 24- 29[S aJ"
^^ IB, I? ^ 24^ 290 aJ"
'' + ItI^ 2iV^ 26£>"
What is VersaWriter?
VersaWriter is an inexpensive drawing
tablet for the APPLE II that lets you
trace a picture and have it appear on
TV display.
VersaWriter is a comprehensive
software drawing package which lets
you color in drawings with over 100
different colors.
VersaWriter is a shape compiler that
converts anything on the screen
automatically into a standard shape
table.
VersaWriter Is a text writer for labeling
pictures with text in six colors and
five sizes. Use English or Greek,
upper or lower case letters.
VersaWriter is much more! Draw with
brush, create schematic drawings,
compute area and distance, edit pic-
tures, save, recall and more.
VersaWriter requires ROM APPLESOFT
and 48K memory.
$299 Suggested Retail
UNIQUE OFFER
Send us YOUR disk and $1 . We will promptly
return the disk with a slide package of 10
color pictures drawn with VersaWriter.
D Enclosed is $1 and my disk.
Send me the slide package.
n Send more information including
VersaWriter dealers in my area.
DEALER INQUIRIES INVITED.
ADDHtbS
LM Y STATE ZIP
Send To: Versa Computing, Inc. • 887 Conestoga Circle • Newbury Park, CA 91320 • (805) 498-1956
58 MICRO - The 6502/6809 Journal No. 40 - Seplemben981
«
APPLE BONUS 3
9
List Controller
LIST CONTROLLER provides
flexibility and ease of operation
when using the LIST command
In Applesoft and Integer BASIC
and the TRACE command when
using the Apple H System
A/lonltor. The programmer can
control the speed of the output
to the text screen using the
game paddle. As an added
bonus those programmers using
Integer BASIC and the Monitor
can Interrupt output to the text
screen without pressing the
RESET key.
Preston R. Black
16 Durham Street
Boston, MA 021 15
The process of debugging a program is
particularly tedious on the Apple, since
there is limited control of the LIST and
TRACE functions. Applesoft allows the
TRACE and LIST speed to be changed,
and the screen output can be interrupted
with 'CTRL-C. However, both Integer
BASIC and the monitor lack even these
primitive capabilities.
While Applesoft does provide the
programmer with these useful debug-
ging aids, there is little flexibility in the
system. Once a particular speed is set in
Applesoft, there is no way to alter the
speed without interrupting the listing
and starting over again. In addition,
Applesoft does not provide any means
by which the programmer can interrupt
the output of his listing for his perusal
and then continue in a simple fashion. A
program which would give the program-
mer the debugging aids of Applesoft in
Integer BASIC and in the Apple monitor,
and also provide all three langauges with
the flexibility mentioned above would
be very useful.
LIST CONTROLLER is a short
assembly language program which does
this. LIST CONTROLLER uses the
Apple game paddles to control the speed
of output to the text screen. The pro-
grammer thus has the ability to change
his output speed from the equivalent of
SPEED = to SPEED = 255 at any time
during his output. The programmer can
therefore speed over those portions of
his program which have been debugged,
and then slow down to concentrate on
those portions of the program with
which he is having difficulty. LIST
CONTROLLER also allows the pro-
grammer the option to output his listing
to the text screen one line at a time, or
an entire page (i.e. one full screen] at
once. All of this can be done without in-
terrupting the LISTing or the TRACE.
LIST CONTROLLER also allows the
programmer using Integer BASIC and
the Apple monitor to interrupt his
listing at any time without the necessity
of pressing the RESET key.
How it Works
LIST CONTROLLER consists of four
interconnected routines. The first of
these is PDDLRDj which controls out-
put speed, using paddle #0 as the con-
troller. TTie Apple game paddles are
analog inputs connected to I50K ohm
variable resistors. The variable
resistance between each input and the
+ 5 volt power supply can be used as a
timing circuit. As the resistance of the
input varies, the timing characteristics
of its corresponding time circuit changes
accordingly. When the timing loops of
the paddles are reset, all the paddle loca-
tions (-16284 ($C064] to -16281
(SC06711 become greater than 128 (that
is, their high order bit is set). The time
for these values to drop below 128 is
directly proportional to the setting of
the game paddle associated with that
location. By polling the game paddle
location and coimting until it goes
below 128, we can get a number relative
to the setting of the game paddle.
The good old Apple monitor provides
us with a routine which does exactly
what we want. PREAD (located at
$FB1E1 polls the paddle pointed to by
the x-register, and returns a value from
to 255 in the y-register, depending upon
the setting of the paddle. The value in
the y-register can then be used to in-
itiate the accumulator before jumping to
the monitor WAIT i$FCA8] subroutine.
This is another useful subroutine which
will initiate a delay of a specific amount
of time, depending upon tbe value of the
accumulator when this routine is called.
The delay, in microseconds, is given by
the equation
DELAY^13-H3.5'A-I-2,5*A^
where A is the contents of the
accumulator. By interrelating the
PREAD subroutine and the WATT
subroutine, output speed is controlled
by the game paddle.
The second routme m LIST CON-
TROLLER is the PAGE routine. This
routine outputs the listing one text
screen page at a time. The text screen is
first cleared by using the HOME
subroutine in the Apple monitor. The
listing is then output to the text screen.
When the screen has been filled, the
listing stops imtil another command is
given. To imderstand how it is deter-
mined that the text screen has been
filled, one must understand how
characters are output to the screen.
Pages 14-17 of the Apple II Reference
Manual tell us that the text screen
occupies pages four through seven of
memory. If we examine the diagram on
page 16. we see that the lines of the text
screen are not ordered sequentially.
However, this is not important since
this diagram also shows us that the last
line of the text screen is at $7IX), And by
further knowing that the address of the
next line to be used for outputting to the
text screen is calculated in BASCALC
($FBC1) and is then stored in BASL|$28|
and BASH($29j, we can poll these
addresses until the end of the text screen
No. 40 -September 19B1
MICRO - The 6502/6809 Journal
59
APPLE BONUS
is reached (i.e. BASL = $DO and
BASH = $07]. We then wait for the.next
command.
The STEP routine is a very simple
routine which polls the output to the
text screen until a 'carriage return' is
detected, indicating the end of a tine of
output. We then go to the DELAY
routine which waits for another
command.
The final routine in this program is
the DONE routine. When this routine is
called, the output hooks at CSWL1$36)
and CSWHi$37| are reset to the original
monitor output routine at COUTl. It
then determines which language the
user is using by polling PROMPT($33],
the address at which the monitor holds
the prompt character. A jump to the
warm start of the particular language is
then executed.
The well-documented program
which is listed should he self
explanatory and should help the
interested programmer to fully under-
stand the routines. The program can be
relocated with a few changes.
How to Use UST CONTROLLER'
Because of the idiosyncracies of the
three languages in the standard Apple n,
1 have had to use three different methods
for using this program— one for each
language. The program is first BLOAD-
ed from disk. If you are in Applesoft,
type '&:LIST' to activate LIST CON-
TROLLER. The colon is necessary for
proper handling of the command. In In-
teger BASIC typing 'CALL 768' will ac-
tivate LIST CONTROLLER and begm
listing your program automatically. To
use LIST CONTROLLER hom the
monitor type (CTRL-Y)xxxxT where xx-
XX is the address with which you wish to
begin tracing. The way the program is
written, game paddle #0 is used to con-
trol output speed. To change to paddle
#1, change the TDX #$0' in the PD-
DLRD routine to 'LDX $#!'.
When I'm not programming or playing
with My Apple D, I am a research fellow
in the Department oi Surgery at the
Brigham and Women's Hospital in Boston.
I have had my Apple foi two years and
have taught myself assembly language
over the last twelve months. Although 1
use my Apple primarily for personal
entertainment, I have had occasion to use
it in my research projects.
03F5
03F5
03F5 4C0003
03FB
03Fa
03F(J
03Fa
03F3
03FB <C0003
D3FB
03FC
03FB
03FB
03FB
0300
0300
0300
0300 A912
0302 8536
0304 fl903
0306 6537
0308 A533
030A C9GE
030C 0003
030E 4CflBE0
0311
0311 60
0312
0312
0312
0312
0312
031?
0312 204AFF
0315 AZOO
0317 ZOIEFB
031A 98
031B ;0A8FC
031E 201FFF
0321 20FDFD
0321 ADOOCO
0337 C99B
0329 F050
032B C9A0
032D F06B
032F C98D
0331 F004
Listing 1
LIST COKTROLLEB
BY
PRESTOB H BLACK
t •
TO USE 'BLOAD' FROU THE
DISK. THEH ACTIVATE BY
USIHG THE FOLLOWING
COHHAHDS:
APPL ESOFT — ' i ; L I ST '
INTEGER BASIC— 'CALL 768'
MONITOK— ' (CTRL-Y)>;X>[X'
WHERE XXXX IE THE ADD-
RESS FROM MHICH YOU
WOULD LIKE TO START
TRACING
4) 1
*a*A4AAk*«***A*'rli>**'**'i'i**'i^***
BASE
BASH
PROMPT
CSWL
CSWH
RETURN
ESCAPE
SPACE
IPWIPT
PGBTM
APRUPT
KBRD
STBB
ABAS IC
iBAEIC
INLIST
PHEAD
HOME
WAIT
coun
KSTOBE
SAVE
MOM
EPS
EPZ
EPZ
EP2
EPl
ECU
ECU
ECU
EOU
EQU
EOU
EQU
EOU
EQU
EQU
EQU
EOU
EOU
EOU
EOU
EOU
EQU
EOU
528
S29
S33
S36
S37
S6D
S9B
SAO
£BE
SD7
SDD
SCOOO
SCO ID
5D43C
SE003
SE04B
SFBIE
SFCS8
SFCA8
SFDFO
SFF3F
SFF4A
EFF69
'l SET AMPEBSANO U) JUMP VECTOE FOR APPLESOFT
ORG 53F5
AHPRSD :
JNP BEGIH
': SET CONTROL-Y JHP VECTOR FOR THE ISOKITOR
ORG 53Fe
CTRLY :
J MP BEGIN
■ •* LIST C0HTEOLI,ER
»■»■******
ORG S3 00
LDA [PDDLRD
STA CSWL
LDA /PDDLRD
STA CSWH
LDA PROMPT
CMP IIPRMPT
BME BETRN
JHP INLIET
RTE
J BESET OUTPUT iiOOKS
J TO ROUTINE AT PDDLRQ
IS PROIiPT ■>'?
NO — CONTINUE
VES — TO INTEGER BASIC LIST
a 1
I
' PADDLE BEADIHG ROUTINE
PDULRD :
JSR SAVE
LDX tSOO
JSR PRE AD
TYA
JSR WAIT
JSR RSTORB
JSR COUTl
LDA KERD
CflP tEECAPE
BEO DONE
CHP (SPACE
BEQ STEPS
CHP t RETURN
BEO PAGE
SAVE BEGIETERE
SELECT PADDLE 10
READ PADDLE VALUE
HOVE VALUE TO ACC
TO MONITOR DELAY ROUTINE
RESTORE REGISTERS
OUTPUT CHARACTER
POLL KEYBOARD
? 'ESCAPE'
YES — FINISHED
? 'SPACE'
YES — OUTPUT ONE LINE
7 'CR'
YES— OUTPUT ONE PAGE
IB 1 REGISTER
(Continued)
&i
MICRO - The 6502/6809 Journal
No. 40 -September 1981
14
Listing 1 iContinaedj
Ixlc
^OIUTPTPTIS
9
0333 acioco
BIT STBB
; CLEAR KEYBOARD
\#\/IVix ItfC X c
0336 60
HTS
I REJOIN OUTPUT
^^^^ W ^%TW^^#%
0337
4
■ ^l# m\ ^#^J I a^ w
0337
; '
mJjVf^..r^.^1.X^...^
0337
I • BOOTISE TO OUTPUT ONE PAGE TO THE SCREEN
^mmi^mMA AAA^#%#
0337
f •
^M^^^K^irt^iM^K ^m
0337
■
WA#C^nCn IT
0337
?flGE:
^ y ^ 1 t* 1 VI
D337 2C10C0
BIT STRB
W m w X ^^XVA
D33fl A94C
LDA tPACEl
.- RESET OUTPUT HOOKS
033C 853fi
STA CSWL
I TO ROUTIME AT PACE
by Mark Pelczarski
033E A303
LDA /PAG El
03flO 8537
STA CSWH
li \ y'^^^^^'^^^^^'iS^tt^
0342 204AFE'
JSR save:
; SAVE REGISTERS
/ / \ ^■'''-"' ''"'''l^htJtf
0345 205BFC
3SS HOME
I CLEAR SCREEN
f / 7 ^■■" W^A
0348 203FFP
JSR BSTOBE
: RESTORE REGISTERS
//"^"^^-U_j^" it^W
03 4B 60
STS
; REJOIN OUTPUT
^f-^^""^^^ -""'Ar\w*-
03 4C
PAGEli
/'''*T">^^ ? C^ Jj^ll ^^\
034C 20FDFD
JSR COUTl
; OUTPUT A CHAHACTEB
1 1 !5"**CL~\ii-\_
034P A528
LDA BASL
i ARE WE AT THE END
/ N^^*^"**! Ij^^Tl
0351 4529
EOR BASH
; OF THE SCREEN PAGE?
\j ^Vv^^/
0353 C9DJ
CMP <PGBTH
V \^^
0355 FOOl
0357 60
BEQ DELAY
UTS
; YES— WAIT FOR ANOTHER INSTRUCTION
J ELSE REJOIN OUTPUT
■ 108 color choices for aato-
0358
03se
03S8
0358
0358
' *
matic filling and hi-res
•
F * DELAY ROUTINE AND KEYBOARD SERVICING ROUTINE
diaracters.
*
*
■ Drawing modes include
0358
0358 ADOOCO
035B lOFB
lELAY :
LDA KBRD
a PL DELAY
; 7KEY PRESSED
i NO — WAIT
lines, circles, ellipses, auto-
matic filling, and user de-
035D C9A0
035F P039
0361 C98D
CMP 1 SPACE
BEO STEPS
CMP (RETURN
; 7 ' SPACE '
; YES— OUTPUT OWE LINE
: ? 'CR'
finable "paintbrushes".
• Design hi-res characters and
0363 D006
0365 2CI0C0
0368 4C3703
036B
BNE DELAVl
BIT STRB
JHP PAGE
DELAVl:
■ YES— OUTPUT ONE PAGE
text fonts that can be plot-
ted at any x, y location on
036B C99B
CHP t ESCAPE
■ ?' ESCAPE'
the screen.
036D POOC
BEQ DONE
■ ^ES--FINIEHED
036F 2C10CO
0372 A912
0374 8536
BIT STRB
; IF ANV OTHEB KEY
• Design shape tables point-
LDA tPDDLRD
STA CSWL
F IS PRESSED THEN
■ RESET OUTPUT HOOFS
by-point with keystrokes
1
0376 A903
0378 8537
037A 60
037B
LDA /PDDLKD
STA CSHK
RTS
TO ROUTINE AT PDDLPJJ
REJOIN OUTPUT
or paddles.
• Easily create, edit, and
037B
ii
manipulate 3-D objects on
037B
037B
' LIST COHTROLLER EXIT ROUTINE
the screen. 3-D figures
037B
037B I
037B JCiOCO
*
ONE;
BIT ETHB
may be entered by coor-
dinates, or by drawing the
037E A9F0
0380 B536
LDA (t COUTl
ETA CSIVL
RESET OUTPUT HOOKS
TO REGULAR OUTPUT ROUTINE AT COUTl
figure's flat surfaces on the
0382 ASFD
0384 8537
LDA /COUTl
ETA CSWfl
screen, then assembling
03S6 A533
LDA PROMPT
the parts visually.
03 88 C9BE
038A D003
CHP SIPKMPT
BHE DOHEZ
IS PROriPT ■>'
• Thorough, easy to use
□3flC 4C03EO
03 8F [
JMP IBAEIC
ON £2 :
YES- -WARMS TART INTEGER BASIC
manual even shows how to
03eF C9DD
C[IP lAPRHPT
IE PROMPT '1 '
use graphics and machine
0391 DOOB
0393 4C3CD4
BNE D0HE3
JHP ABASIC
YEE— WARMSTART APPLESOFT
language routines in your
0396 L
0396 4C69FF
011E3;
JMP HON
DEFAULT TO HOHITOR WAHHSTART
programs. only $59.95
0399 60
RTS
03 9A
03 9A
ii
Also available: .
C39fl
03 9A
- EOLTIKE TO OUTPUT ONE L
K
NE
THE 100-COLOR DRAWING
03 9A
:•
SYSTEM contains al! of the
03 9A i
03 9A 2C10C0
D39D A9A6
TEPSi
BIT STRB
LDA SSTEP
RESET OUTPUT HOOKS
2-d!mensionaI functions of
the above.
03 aF 8536
03A1 A903
STA CEWL
LDA /ETEP
TO STEP ROUTINE
THE 3-D DRAWING SYSTEM
03A3 8537
STA CEMU
contains the 3-dimen5ionaI
03A5 60
03fl6 £
RTS
TEP:
REJOIN OUTPUT
utilities. S32.95 each
03A6 C9aD
CUP tSBD
?CAfiRIAGE RETURN
DOS 3.2 or 3.3, requires Applesoft
D3AS F004
03AA iOFDFD
03AU 60
03 AE s
03AE ZOFOFD
DEO STEPl
JER COUTl
RTS
TEPl:
JSR COUTl
NO — CONTINUE OUTPUT
REJOIN OUTPUT
YES — OUTPUT CARRIAGE RETURN
firmware or language system.
CO-OP 6
D3B1 D0A5
BNE DELAY
THEN TO DELAY ROUTINE
CfXwTX 1 VMf*0
03B3 50
RTS
BHB
REJOIN OUTPUT
SOilwdrc
^
Post Oflice Box 432
West Chicago, IL 60185
(312)231-0912
\ is\,i[ili m.\s[[ h( \m>,ii.i'|iiL,i
MCftO
COMING SOON: moi« graphics
utilities and a tablet version!
No.40-Seplember1E
)61
MICRO - The 6502/6809 Jouma
1 61
APPLE BONUS
Lo-Res Graphics
and Pascal
ii
The Apple language card
precludes the use of the normal
low resolution plotting routines.
This article offers a library of
assembly language procedures
that allows you to plot low
resolution graphics using
Pascal.
C. Donald Heth
Department of Psychology
The Unversity o1 Alberta
Edmonton, Alberta, Canada
TG6 2E9
One of the principal attractions of the
Apple n is its capacity for expansion.
Not only can the Apple owner add a
plethora of peripheral devices, but he
can also change the very "personality"
of his machine. Perhaps the most
significant development in this latter
cormection was the Apple II Language
Card, With it, the Apple owner can turn
a hobbyist machine into a sophisticated
computer system using one of the
foremost languages of the computer
industry, Pascal. As discussed by John
Mulligan (MICRO, 29;59|, Pascal pro-
vides the programmer with a very
powerful set of programming tools. The
Apple n owner Interested in serious
applications of his machine will find
Pascal well worth considering.
However, he may fmd one feature
disappointing. Because the Language
Card functionally replaces the Apple
monitor, it gates out many of Apple's
intrinsic features. The feature that the
new Pascal owner is likely to miss is the
Apple's low resolution graphics
capability. While Pascal has an excellent
graphics handler, it is restricted to the
standard high resolution color set. There
are no defined procedures to produce the
rainbow of colors for which the un-
modified Apple is famous. So, while the
Pascal user will undoubtedly conclude
that Pascal's power is worth the
sacrifice, its lack of low resolution
graphics is likely to keep him forever
nostalgic, or turn him into a closet
BASIC user.
To help advance the Pascal move-
ment, I'd like to report on one way I
have found to generate low resolution
graphics from Apple Pascal, It permits
plotting on either page of the low resolu-
tion screen.
As readers of the Apple Reference
Manual know, low resolution graphics
in the BASIC Apple are generated from
RAM data in the range $400 to $BPF,
with the first $400 hex locations
designated as "page one" and the second
as "page two." This is also the area
which contains text data when the
Apple is displaying text. Whether text or
data are displayed is determined by
whether location $€054 or $C055 was
last referred to.
This same memory range is reserved
m Pascal to display text. The old page
one contains the first 40 columns of
text; the old page two contains the
second. Hitting "Ctrl-A" from the
keyboard simply switches between the
two pages. But, despite the use of this
range for text, the soft switches control-
ling the display of text or graphics are
stUl functional. To verify this, perform
the following experiment.
Type in the program of listing 1.
This is a series of assembly language
instractions that refer to the soft
switches controlling the display of text
Listing 1
"HE PnLLriklHG PROCEDURES "THROU" THt
PPPROPRIfiTE SOFT SWITCHES TO EFFECT THEIR;
RESPECTIVE FUNCTIONS. "COLORl" fiNO "COLORE"
DISPLhV Li'iH RESOLUTION SRClPHICS ON THE FbLL
SCREEN OF THE PRIMflRV RHU SECOHOfiRV PFuBE,
RESPECTiuELV. "te;-:ti" displpvs hll text Pjt-i
THE PRIUflRV PhGE. OTHER CfDHBINhTIOHS OF
SWITCHES COULD BE USED TO DISPLhV MIXED TE;;T
HND GRfiPHICS ( SEE PflbE 13 OF THE RPPLE 3C
REFERENCE HflHUflL ).
.PROO COLOP.l
Lnf)
61.050
LGFi
eca52
1 m
0Ce54
\m
OC05S
RTS
.PROG C0L0R2
LDfi
0C050
1 nft
0C652
infi
9C055
IDR
acase
RTS
.PROC TEXTl
LDfi
acasi
LDR
0Ca54
RTS
• END
62
MICHO - The 6502/6809 Journal
No. 40 - Septemberl981
APPLE BONUS
or graphics. The mstnictions under the
heading .PROC COLORl turn on the
graphics of page one; those under .PROC
COLOR2 and PROC TEXTl turn on
page two graphics and page one text,
respectively. For those readers who have
not yet used the assembly langauge
capabilities of Pascal, these routines
will ultimately be integrated into the
main Pascal program and called as
procediues.
After you have typed listing 1, save it
in a disk file (e.g., imder the name
ASMDEMO]. Then type in listing 1,
which is the Pascal program to use these
routines. Notice that there are procedure
declarations corresponding to each
assembly language routine. These pro-
cedures are then called in the main body
of the program. Listing 2 should
likewise be saved in a disk file.
Now you must use the system
assembler, compiler, and linker to
integrate the two programs. Follow the
instructions given for the example in
section 1.9.].l of the Pascal Reference
Manual. Rtm the linked program. The
system responds with its usual "RUN-
NING..." message. Hit carriage return,
and you should see an immediate switch
to the bar pattern of a non-cleared low
resolution screen. The irregular colors
in the upper left, of coimse, are the color
translations of the message character.
The next carriage return switches to
page two; the pattern in the upper left
disappears. Finally, the next carriage
return will retimi you to text mode and
end the program
H
Listing 3
PROGRhlH COlQRQEHOj
Kim
kESPOHSE : CHflR>
;-^ : 0..39,-
V : 0..47;
COLOR : 0..i5;i
PROCEDURE COLORl i EKTERHflLi
PROCEDURE C0L0R2; E«TERNRL;
PROCEDURE TEXTlj EXTERNflLj
PROCEDURE PLOT£<ft,V, COLOR: INTEGERS; E^TERNfiL;
BEGIN
COLORS;
FOR /. := TO 39 DO
FOR V :- TO 47 DO
KLuT^c:";.Y.t>>;
TEKTl;
REPEAT
bOTU>iV<0.j>i
HRITELhi:'" ■'>}
SnTO'?.:'A0,l 'j
NRITELNCENTER X. V, HND COLOR' ,■*
HRITELN<:'HIT <CR> TO DISPLflV PLOT; <CR> TO RETURN' >;
REflDLH(;X,V, COLOR >>
CnL0R2;
PLuT2cX.V. COLOR?:
REfiDLNCKEVEOPiRD, RESPONSE ^ij
TEXTl;
WRITELN( TYPE '■Q" TO 0UIT* SPACE TO CONTINUE'):
HRITELHCTHEN HIT :CR>- >;
REflDLH': RESPONSE?;
UNTIL RESPONSE = ■Q-'i
END.
Listing 2
PRG3RRM S
MITCHuEHOi
URR
RESPOHS
E : CHRR;
PROCEDURE
COLORl; EXTERNAL;
PROCEDURE
COLORS; EXTERNOL;
PROCEDURE
TEXTl; EXTERNAL;
BEGIN
rehdln< response;';
LULORl;
REflDLN'; RESPONSE.*;
CCLORZ'i
RERDLN-; RESPONSE >i
TEXTl;
END.
So, Apple Pascal can generate low
resolution colors — if we can put the
right data into the right locations of the
low resolution pages. Normally, this
computation is performed by the Apple
monitor, but again, it has been disabled
by the Language Card.
The solution I suggest is an assembly
language routine like the ones used to
switch the colors on and off. Listing 3
contains such a procedure, labeled as
PLOT2. It is set up to accept the X and Y
coordinates, and the color to be plotted,
as parameters. This gives the user closer
Listing 4
.[■thlCRO POP
PLfl
SIR y.i
PLfi
STft ■'.1 + 1
.ENOM
.PROC PL0T2.3
5HMPLE MRCRO TO POP 16 BIT
HORD FROM TOP OF STACK.
PLOTS
THIS PROCEDURE TAKES AS ITS PPRAHETERS AN :-!
COORDINATE c0..3S>- A V COORDINATE >.:0..47>.
HND H CGluR ':0..15> and plots a LOW RESOLU-
TION BLOCK OH THE SECONOARV PRGE < SEE PASES
17-13 OF THE apple It REFERENCE HANUAL FOR
COLOR fiND COORDINATE ASSIGHHENTS >.
(Continued)
No. 40 - Seplember 1981
MICRO - The 6502/6S09 Journal
63
APPLE BONUS
Listing 4, (Continued!
THE ROUTINE CmH BE USED TO PLOT ON THE PRI-
HflRV PAGE BV HLTERIMS THE INSTRUCTION
LABELED "PhGENUHE" TO RERD "ORH tt04".
LOCflTIOHS 000^ HtlD 0006 ARE USED FOR
TEMPORflRV STORflQE.
RETURN
.EQU e
POP RETURN
PLfl
'STR CLR
FLH
LUH *f0F0
STfl HftSK
PLh
PHfl
PHh
ftNO t30
LSK h
STfi 5
hSL FI
hSL H
ORR 5
3TH •:■
PLfl
AND tOE
RGR H
ROR R
PflbEMUNB ORR #08
STR 6
ROR fl
PHD #80
ORR 5
STR 5
PLfi
RHU *01
BEO SKIP
fiSL CLR
RSL CLR
RSL CLR
RSL CLR
LDR ttaF
STR MRSK
SKIP PlR
TVR
STR VSTOR
PLfl
TflV
H-fi
LDfl G5,V
hHO MRSK
ORR CLR
STR IS5.V
LDfl V3TQR
TflV
LDfl RETURM+l
PHR
LOR RETURN
PHH
RTS
i USE LOCflTION 0600 TO
; STORE RETURN RDDRESS.
; PUT LOUER-iDRDER BVTE OF
; COLOR flRGUHEHT IN cLR,
i RND DISCRRD HIGH EVTE.
; SET UP BIHRRV HflSK
; RT mst.:.
i het lower-order bvte
i OF V cooroihrte and
i DliPLICRTt ON STACK,
; STRIP BITS 0-3 AND 6-7.
TRRIISFER bits 4-5 TO
POSITIONS 3-4.
THEM DUPLICRTE PflTTERN
IN POSITIONS 5-e,
HHD STORE IN 0395.
GET LOU BVTE OF V COOR.
STRIP BITS RHD 4-7.
TRANSFER RESULT TO
lRRRV flNO BITS a-i.
COMBINE NITH PfiGE LIMIT
RHD STORE IN aOeC.
TRRNSFER 0RI6INRL BIT 1
TO POSITION 7 RND
CONBIHE HITH CONTENTS
OF S00^i.
GET LOM BVTE OF V CuOR.
IF ODD,
THEN SHIFT COLOR CODE
TO POSITIONS 4-7
OF CLR,
AND CHANGE MRSK.
; DISCARD HIGH BVTE OF V.
1 SRUE V REGISTER.
i GET LOH BVTE OF A COOR,
; TRflHSFER TO V REGISTER,
; RNO DISCARD HIGH BVTE.
i GET BVTE ON SCREEN.
-, ERASE OLD COLOR.
i COHBINE NEW COLuR
i AND PLOT.
; RETURN V REGISTER.
J GET RETURN RDDRESS
CLR
HflSK
VSTOR
.BVTE
.BVTE
.BVTE
.END
i RNO RETURN.
control over the color than that afforded
by the routine which comes with Apple-
soft. I won't go into the details of listing
3, except to note that, through bit
manipulations, it transforms the
parameters passed to it by the host pro-
gram into the appropriate addresses in
the page two memory range. If you'd
like to plot on page one, change the line
labeled PAGENUMB to ORA #04. You
could even rewrite listing 3 with the
modification and put it under the
heading .PROC PLOTl. Then you could
plot a point on either page by executing
PLOT2 or PLOT2.
Save and assemble listing 3 under
some name. It can now be linked, along
with listing 1, into a Pascal program
which uses the procedure PLOT 2
(X,Y,COLOR). I've written listing 4 as
an example. To use it, type, save, and
compile it, and then link it (as the "host
file"] to the assembled versions of list-
ings 1 and 3 (as the "lib files"]. When
you run it, it will begin by visibly clear-
ing the screen. Then it will switch back
to text to ask for the coordinates and
color of the point you wish to plot. Type
the X coordinate, Y coordinate, and
color number, each separated by spaces.
Hit carriage return, and the program will
plot the low resolution point on the
screen. The next carriage return will
bring you back to text to plot another
point. The Pascal program isn't very
elegant, but it should help to demon-
strate how these routines can be used.
Hitting " Ctrl- A" during the program
seems to interfere with the plot; I
haven't located the reason yet. Also, the
plotting routine could be written in such
a way that the color of the point is deter-
mined by a global variable in the Pascal
host program, rather than by a procedure
parameter. This would be similar to the
way plotting routines are handled in
Applesoft. This could be done by the
assembler directive .PUBLIC, which
allows communication between the
assembler and Pascal programs through
common variables. Fhially, I suggest
that listing 3 be adapted as BASIC
routine. Using it, one could plot on page
two directly, without having to move
chunks of data from page one. Just how
it could be adapted is left as an exercise
for the reader.
I've found Pascal to be an extremely
attractive language. Before I developed
these routines, however, I occasionally
missed the low resolution graphics of
Applesoft. Now, it's ruce to know you
can have your Apple and eat it too.
Donald Heth is an Assistant Professor at
the University of Albeita. He is interested
in microcomputers as tools for
psychological research.
" MCftO
<a
^
64
MICHO - The 6502/6809 Journal
No. 40 -September 19B1
the BEST <] AND l> the BEST
keyboard buffer
iSHItTKKY UPPER/LOWER CASE CONTHOL
$119.95
■f More buffet than others.
4 Clear buffer control.
4 SHIFT key entry of uppoc/lowec c^se.
4 Easy CTL key access to special chars
■' I - ■ ( ) _ I \ a ■ .
+ Allows BASIC programs with standard
INPUT to support Lower Case without
software modif icatior].
+ A lower case adapter is required
to display lower case,
Separately, th-ey have more features
and out perform all the rest. But
together as a team they perform evei
better. Look for the Graphics +Plus
soon. It's a RAM based character
generator to ccupliinesit the Liwer Case
tplus. It will ail<w you to define the
character set to your needs. You could
load German, French, Scientific,
Engineering or any other special
characters into the Graphics +Plus and
use it as if the J^le II was designed
specially for that application. And
that's not all. If you define the
characters as graphics, you can do
extremely fast HI-HES type grai*ics on
the text screen without all those
cumbersome and slow HI-RES routines
and 8K screen. For all the details on
this triad of products, send for our
free booklet 'Lower case adapters and
keyboard buffers fran the inside out".
This booklet gives all the details
about lower case adapters and keyboard
buffers in general. It also has a
section on the Graphics +Plus (RAH
based character generator) .
lower case adapter
■^^^
GHAPNICS a LOWER CASE CHARACTER GENERATOR
FOR THE APPLE II COMPUTER
$69.95
Corona, CA 91720/
(714)735-1041 /
* Normal & Inverse Lower Ca^e.
+ 2 complete character sets on board.
+ Graphics chaEacteL font buiJt in-
+ EjLpansion sockec allows access to
external chaiactei sets,
t 2716 EPROH compatible char genecatcr.
+ More suppoiting software, [on diskette)
4 Keyboard +!>lus £ Graphics +Plua designed
around the Lower Case +Plus.
DOSOURCE 3.3 DISASM/65
for the Apple II
A source listing of DOS 3.3
Disassembled & commented by Randy Hyde
We took our DISASM/65 disassembler program, disassembled
Apple's DOS 3.3, and added meaningful lables and comments to
create DOSOURCE 3.3, a perfect companion to "Beneath apple
DOS" by Don Worth and Pieter Lechner*. DOSOURCE clearly lists
each routine used by Apple DOS.
by Randy Hyde
DISflS«/65 IB a LISA coiii[JaCit>le 650Z disassembler foe
the Apple II. DlEflSM/65 takes unadotned machine code flnd
converts it to an understandable aBseiubly language text
file. DISASH/65 allows users to disassemble 650?
instruction codes, hex duta^ string data, address data,
stack data, and motel DlSAEM/6^ ts by £ai the most
powerful 6502 diaassembler available Coi the I\.^\e ll.
in fact, wc need it to disassemble doe 1,3 for our
UOSOURCE package. Over 500 happy kisers bought DISAaV65
Eor £24.9^ wittiout the source listing (The soucce
listing wds available Cot $3^.00 eKtra) , Now, (or a
linited time, you get botti the DiSftsV65 program and the
source listing for $29.95 1l]ISASM/fi5 sources are in a
LISA l.f compatible format). Complete documentation
included.
DOeoupCt is a LISA 2,5 compatible soutce listing
of DOS J.J, LISA 2.5 owners can load and reabSemble
DOS at other locations Cor special applications
(such as in a RAH card). DOSOURCE is also a text
file that can bo loaded into your favcnte assembler
and converted for use with it. DOSOURCE is alf50 &ii
assembled listing that you can dump to a printer for
reference purposes.
With DOSOUnCE you can;
-> i^Qassemble DOS 3.3 at different addree&es.
-> Utilize several useful rifutines found within DOS,
such as deoimal input and output. Many routines
within DCS are as useful as routinos found within
the Apple monitor .. .only you didn't know about
tliem until now! !
-> Remove portions o£ DOS, that you may not need,
freeing memory for progcan use. Host programs do
not need the ^REriAME", "UNIT", "BSAVE", "BBLiI]',
"BLOAD". "CATALOU"- eCo. commands while they are
running. As much as 4K can be fenoved from DOS
vithout affecting your programs operation. Think
about it the next time you got a MEH FUEJ, error
or need to declare an array that's just a little
bit too big,
-> Learn lot "^s of 6502 programming tricks - doe 3,3
Is full of 'em. And you can learn them by
studying the source listing.
-> Hake "Patches" to DOS 3,3 and understand exactly
whats going on. No more "guessing gajue' resulting
in unreliable software.
SPECIAL rNTRODUCTOnV PRICE S39,95
wilh 'Benealh Apple DOS' $55.00
' Beneath Apple DOS i& published by Ouality
software. Suggested list 519.95
No. 40 - September 1 981
Lazer Hie roSystems' products are in computer
stoies all across the country. However, i£ you
cannot locate one, you can order direct from us
at 1719-G Capital, Corona, Calif. 91720,
* California residents must add 6!. sales tax.
* Mastei Card ^ Visa {v/all ^ital mfo) welcome.
■ Allow ? weeks additional for checks to clear.
' Orders outside U.S.A. add Sl.5.00 for shipping
4 handling.
Lower Case +Plus, Keyboard tPlus, and Grapbics
tPlUB are trademarks of Lazer HicroSystemb,
Inc., corona, Caljf.
Apple II and Applewriter are trademarks of A|^le
Computer, Ino., Cupertino, Calif.
MPCRO - The 6502/6809 Journal
65
APPLE BONUS
Dollars & Sense Revisited
This article describes print
formatting in Applesoft BASIC
using a MID$ statement.
David T. Delli Quadri
Box 1736
Steamboat Springs, Colorado 80477
One of the great joys of programming in
BASIC is the way that one can solve the
same problem in many different ways.
Sometimes the thinking set one brings
to the problem dictates the kind of solu-
tion one seeks. One often finds the sim-
ple solution to a problem while working
on something quite different. 1 have
been writing a program to act as a ski
race secretary — shuffling, sorting, and
printing the various lists of names and
times generated during the course of a
two-day ski race. One of the problems
which I had to address was the output of
times to the hundredth's decimal place,
a problem similar to that discussed by
Barton M . Bauers in his article
"Business Dollars and Sense in Apple-
soft" which appeared in the August
1980 issue of MICRO (27:65]. I was sur-
prised to find how dissimilar oui solu-
tions were.
The problem, you will remember, is
two-fold. First, in Applesoft one does
not have a PRINT USING command or a
print formatting capacity. Zeros trailing
a decimal point, and the decimal point
itself, will be omitted where no value
follows the decimal. Both of our solu-
tions involve tailoring an alphanumeric
variable to suit oui needs. Second, the
tendency of rounding errors to crop up
in the seventh significant digit must be
overcome in handling cents. It would
never do to output .2999997, rounded to
.29 when the answer was really .30.
Bauers chose to handle this problem
at input, converting and carrying his
variables as integers. They must, of
course, he reconverted at output. I chose
to eliminate this step, and put the cor-
rection in as I set up the alphanumeric-
tailored variable.
My solution is, where N is the
number to manipulate, and N$ is the
tailored alphanumeric to be printed:
10 N$ = STRS(N + 1.005 -
SGN(N) ' INT(ABS(N)))
20 N$ - STR$(SGN(N) *
INT{ABS(N))) +
MID$(N$,2.3)
The Applesoft BASIC will return a
5E-03 when + .005 is used, and this
will be carried into the string. To pro-
tect against this 1 use a 1.005 adder for
correction, then ignore the first digit. It
is also advisable to use a fix-rotmding
situation rather than depend on the
INT|| function which will round down
with negative values.
Listing 1 is a simple program which
illustrates the above two lines as used
in a program.
Dave Delli Quadri works as a contractor
in the summer and a micro-programmei in
the winter. Specializing in computer
applications for ski competition, his
programs have been used by the U.S. and
Canadian Ski Associations for both
jumping and alpine tournaments.
^
10
20
30
40
50
60
70
80
90
100
REM
REW
REM
REM
REM
HCME
INPUT
PRINT
PRIST
Listing 1
A CHECKEOCK BALANCING
PRCGRAM TO ILLUSTRATE
A SOLUTION TO A PRINT
POIWATTItJG PKCM1.EM...
";BALRNCE
-NN.NN"
"ENTEE aJRREWT BKLPISCE
z PRINT "EHTER CHECK AS
: PRINT "ENTEK DEPOSIT AS NN.KN"
PRINT : HTAB 20: INFUT "";CHBCK
105 BALANCE = BALANCE; + CHECK
110 BA$ = STR? (BALANCE + 1.005 -
CE) * INT { ABS (BALANCE)))
120 BA$ = SrR$ ( SGM (BALANCE) *
BALANCE))) + MID? (BA$,2,3)
130 PRINT : PRINT "NEK BALANCE IS
140 PRTNT : INPUT "ANOTHER ENTRY?
150
160
SCSI (BAIAN
INT ( ABS (
$ ";BA$
";AN$
IF LEET? {AN$,1) = "Y" THEM 80
END
]RUN
EWTER CUBEENT BALANCE 156.89
ENTER CHECK AS -NN.NN
iWER DEPOSIT AS KN.NN
JUCRO'
66
MICRO -The 6502/6809 Journal
No.40-Seplember1981
1
A STATISTICAL ANALYSIS
AND FILE MAINTENANCE SYSTEM
FOR THE APPLE IP" UICROCOMPUTER
As a Subset Language of P-STAT^" 78...
A-STAT™ 79 computes:
FflEQUENClES
BI-VARtATE TABLES ■ CHr SQUARES
CORRELA-nON MATRICES
MULTIPLE REGRESSION
RESIDUALS
APPLE PLOT INTERFACE
APPLE FILE CABINET INTERFACE
FILE SORT
AQQREQATION
REPORT WRITING
COMPLETE TRANSFORMATION LANGUAGE
READS VISICALC FILES
A-STAT™ 79
Uses Standard DOS Text File and EXEC's
48K Version — All programs in Applesoft""
A-STAT^M 79 is available Irom:
ROSEN GRANOON ASSOCIATES
296 PETER QREEN ROAD
TOLLAND, CONNECTICUT 06084
(203) 875-3541
A-STATT" 79 or Disk with 95 page manual,,, S125.00
Apple II I"" Is a iiadsmaih oJ ihe Apple Compuier Inc
P-STATlm ?Brsa tiaflemarkolP-STATInc. Ptmcelon NJ
A-STAT im 79 Is eppyipghled tiy Gaiy V. Granflon, Ph.D.
W/KROM TECHNICAL PRODUCTS PRESENTS
A DIAGNOSTrC PACKAGE FOR THE APPLE II
AND APPLE II + COMPUTER.
"THE BRAIN SURGEON"
Aopie Cortipuler Co lias piov\aaii you wiin the besi equlpmeni avairatwe To dale. Tlw
Diagncfiiic's Package was designed (o checli avflry mapoi a^ea oi your compuier, detect eii&i5,
and ie[wn any mal'uncrioris Thv 0tmin Surgtan inM pui ycur sysiem Hirough eHhauslivg,
thotougJt piocedures, [eslmg and reporlmg all findings.
The lesls fnciu<le-
> motherbdahd hqv test
■ APPIESOFT ftOM CAPO TEST
4 inrEi^ER KQW CAPO TEST
■ WQlHERGDAqQ RAM TESTS
■ CISK DmVE SPEED CALlSlATlQf^
* DISK DHIUE MAINTENANCE
* DC hAYES MiCnOMOUEM ■' TEST
{l'AR[>WAnE A EPHOMJ
- HDhlTOH £ UOOULjMOR FLOUTIN&S
' monitor spewing tests
' wonftop test pattern
■ monitor text page test
' WDNITOA i TV YOKE AUGNMENT
■ LO RES COLOR TE^TS
- HI PES COLOR Tf SIS
> RANDOM HI RES GENERATOR
■ SPEAKER FUfJCTlOW TESTS
< SQUARE VVAVE WOOUI-AEfiN
' PAODIE i SPEAKER TEST
■ PAOCLE a BUTTON TEST
■ PADDLE STAGlUTt
■ INTERNAL WAINTEhANCE
' (GENERAL HAIhJiENANCf
t ON BOARD -HELP'
Tht Bioin SuT]j9ap allows yoj lo be confideni o1 your sya'erri T^is \5 as criricaL as in&
operalrng iyslem piwK You musf depend on your compuref iCOVa ol iTs rjnnmg lime. Iftt
Brain Surgeon «!!! monitor and help rrainlam aDSQlute peak pwfwmarce-
SuDpi>U on jiikeiir wlf campleW
dEicun^an [alhirh >nd mdinierijnce ouiOa
PPiCE UB9i
PEQUIRES iflK FP pH ROM
I av> Oii'^ cos 3? or a 3
■- Nikrom TechnicaJ Products
?S PROSPECT STREET ■ LEOMINSTER. Ill* QlUa
Call jQilfrM Now!
W^lir- cr^arge & VISA ^iati ca" I-80OS3S-A4G
Ka-nii Pes-dfl-Hs ca'i i -BOG- Jfl? ?a2i
Singing the file cransfen blues'? Then...
Get; B. I.T.S.!
U&R your tVliCrnmodRm K, A I OC^^r'd. ar
Apple? Comni Cai-fl'^ to.
Send data files, BASIC programSj
even machine code
to rnoBt computer^ oven phone I ines-
Copy anything you see
into a SIK tiuffpi- Lhien stsve it on disk
andJor print it under* your comp^ece control,
Many more features!
See it at; your faworice con^puter
store today.
TraQcmarh^ hVlO b f.
es U iC'Oeanlp iilAr Pradudt |nC-
s ' s a M
3- Apple Conpular Inc
T. S ■« A T rBden
rf of
MicroSoft:ware SyetBme
7BSV Jones Branch Dr- SLiite.^QO
Mt Lean. Vmgjnia 221DS
[7D3J 3a5-29^-a
IF Stfll'L PJUMHER IS HllOW JOODO OR D*Tt[f
BEFOOEil^l THtF.HETI,Bh DtantTTE PLUSIHB
SBCS
PUTS
YOU
ON TOP
Organize your business with
accounting software from SBCS:
• General Ledger
• Accounts Receivable
• Accounts Payable
The above programs can be used alone or inte-
grated. They include extensive error checking
and data entry prompting, numerous reports,
departmentalizing, and budgeting. Detailed doc-
umentation included.
Get on top of things! Call or write today.
SMALL BUSINESS COMPUTER SYSTEMS
4140 Greenwood, Lincoln, NE 68504 (402) 467-1878
No. 40 -September 1981
MICRO - The 6502/6809 Journal
67
APPLE BONUS
Paddle Hi-Res Graphics
<ii
This program lets you draw a
background scene on the Apple
Hl-Res Graphics display using
paddles. Data points are gathered
according to the user-definable
coordinate space. A series of
DATA statements are created on
a disk text file which can then
be EXECed into any program.
Kim G. Woodward
6526 Delia Drive
Alexandria, Virginia 22310
Apple owners are continually searching
for shape maker programs. With a shape
maker, you can define a shape to meet
the needs of your program and then
XDRAW the shape on a landscape
background, creating exciting games.
There has been a myrid of programs to
create shapes, but few to create the
backgrounds. This program allows you
to create that background.
Paddle controls the X movement,
and paddle 1 controls the Y movement.
The X-, Y coordinates from the paddles,
in the user's coordinate system, arc
displayed as well as the status of the
"pen." As the movement of the paddles
draws a picture on the screen, the
coordinates and the pen status arc main-
tained in a vector array. At the conclu-
sion of the background drawing the
Apple will respond with a request for a
starting line number and a text file
name, in which data statements will be
stored. In this data statement mode the
Apple will create a series of DATA
statements starting with the given line
number and increment and place them
onto the given text file. From the text
file the statements may then be EXECd
into any program to provide a perma-
nent storage of the required background.
This program makes use of the win-
dowing transform which takes a series
of points in a defined "window" and
transforms them into a series of points
on a defined "viewport." For example,
if I have a series of points from a plot
whose X axis goes from 10 to 20 and
whose Y axis goes from - 15 to +35,
this is my defined "window." If 1 wish
to plot them on the upper right portion
of the Apple's screen, in a defined
"viewport" whose X axis goes from 140
to 279 and whose Y axis goes from 80 to
0, then I would use the windowing
transform:
X' = 13.90 • X -f 1
y = -1.60 ' Y -I- 56
The transform is defined as follows:
X' =
Y' =
X
Y
B
D
where:
WV2
I X.Y
I
WV1 I
W2
W1
WHl WH2
window
X',Y' I
I
I
VH1 VH2
viewport
A = (VH2-VH1)/(WH2-WH1)
B ^ VH1 ■ A ' WHl
C = (VV2 - VV1) / (WV2 - WV1)
D ^ VV1 - C * WV1
The windowing transform is used to
go from a user's coordinate system, the
"window," to a device's (plotter,
graphics screen, etc.) coordinate
system, the "viewport." As you can
see from the example, it is not
necessary to fill the entire device; the
example uses one- fourth of the screen.
As a matter of fact, the windowing
transform can be used to "zoom" in on
a particular area, using clipping to get
rid of unplottable lines.
Listing 1
10
REI'i ENTER X(l},Y(l),b'(I),I = l..i^
20
KEy, X(I) IS X CCi-lPONENT
30
Rbi-I Y(I) 13 Y COMt'OcJENT
40
KEM P(I)=1 PliiJ Uf BEFORE MOVE
50
KL.-l P(I)=0 PEN DOWN BEEORE MOVE
60
POKE 232,192: POKE 233,3
7U
FOR I = 960 rO 970: READ Z: POKE I,Z: NEXT I
80
DftTA 1,0, 4,0, 54, 196, 111, 32, 86, 53,0
90
DIM X(200) ,Y(200) ,^4(200)
100
KEK DRAW SCPEE!^ FROM PADDLE
110
TEXT : HOME : ROT= 0: SCALE^ 1: hCOLOR^ 3
120
INPUT "XMIN VALUE (LEFT SIDE)? " ; XI
130
INPUT "XKAX VALUE (RIGHT SIDE)? " ; X2
140
INPUT "Y.^IN VALUE (BOTTOM)? ";Yl
150
INPUl "YMAX VALUE (TOP)? " ;¥2
160
AZ = {X2 - XI) / 279:ii7. = X1:CZ = (Y2 - Yl) / [ - 159
) :DZ = Yl - 159 * CZ
no
HGR :F =
180
VTAE 22: HTRB 1: PRIl>iT "PEN IS UP"
190
■GUSUB 870: REM GET PADDLE POSITION
200
XDRAW 1 AT X.Y
210
XL = X:YL = Y
220
N = 0:G ^
230
REM REPEAT START
240
GCSUB 870: REM GET PADDLE POSITION
250
XDRAW 1 AT XL,YL: XDRAW 1 AT X,Y:XL = X:YL = Y
26
If PEEK ( - 16384) <: = 127 THEN 840; REM IvAS KEY
PRESSED?
ra
MICRO - The 6502/6809 Journal
{Continued)
No, 40 - September 1981
1
APPLE BONUS I
•
The Progiam
The program begins by POKEing the
"plus" cursor shape into locations
starting at $3C0 which are above most
page 3 utility routines and out of the
way. The program then requests the
user's min/max user screen values. If
the values entered are 0, 279, 159 and 0,
then the data recorded are the screen
values themselves. However, if you are
entering only one-fourth of an actual
background then these numbers must
change. The heart of the program is a
REPEAT-UNTTL loopi the ESC key is
the trigger to leave. Within the loop, as
long as no keys on the keyboard are
pressed, the loop continuously reads the
current paddle cursor position,
XDRAWS the cursor over the old cursor
position, and XDRAWS the cursor at the
new position. In this way the cursor
appears to move over the entire screen
without disrupting anything that has
already been drawn.
The subroutine at the bottom of the
program listing reads the cursor position
from the paddles. Note that the paddies
normally read from to 255, clockwise.
The subroutine reads each paddle and
converts it through the windowing
transform to appropriate screen co-
ordinates.
Note that paddle I values are re-
versed so that with a clockwise rotation
the cursor goes ' 'up' ' instead of
"down." The program locks out all but
three keys. The space bar changes the
"pen" status: if the "pen" is up, no
lines are drawn; if it is "down," lines
are drawn and data is taken. If the "pen"
is down and the return is pressed, then
the current cursor position is taken as
the data point, if the "pen" was "up,"
and is now down previous to pressing
the return key, then data is stored with
an indicator, P%i), of 1, indicating to
move to this point, i.e. HPLOT X,Y. If
the "pen" was "down," and is now
"down" previous to pressing the return
key, then data is stored with an in-
dicator, P%||, of indicating to draw a
hne to this point, i.e. HPLOT TO X,Y.
To start taking data, the space bar must
be pressed until the "pen" is down and
then the return key is pressed. When the
ESC key is pressed, further recording of
data ceases and the creation of DATA
statements begins.
Kim G. Woodward works as an electronic
engineer for the U.S. Coast Guard in
Washington, DC. He has been in the
computer field for len years. Woodward's
current interests include software
engineering and utility type programs.
MCftO
270 K = PEEK ( - 16384) - 128: POKE -
16368,0
280 IF K < > 32 THEN 340: REM KEY IS
SPACE?
290 CALL - 1059: REM BEEP SPEAKER
300 IF F = THEN F = 1; VTAB 22: HTAB
1: PRINT "PEN IS
DOWN": GOTO 32
310 IF F = 1 THEN F = 0: VTAB 22: HTAB
1: PRINT "PEN IS
UP ":G =
320 REM CONT.
330 GOTO 840
340 REM CONT.
350 IF K < > 27 THEN 640; REM KEY IS
ESC?
360 TEXT : HOMt
370 INPUT "NAME OF FILE? " ;A$
380 PRINT CHR$ (4);"0PEN ";AS
390 PRINT CHRS (4);"DELETE " rA5
400 PRINT CHRS (4), -"OPEN " ;AS
410 INPUT "STARTING LINE NUMBER? " ; 11
420 INPUT "INCREMENT? ";12
430 PRINT CHRS (4), -"WRITE " ;AS
440 PRINT 11;" REM " ;A$
450 11 = U + 12
460 PRINT H;" DATA " ;N; " ," ; XI ; " , " ;X2; " , " ; Yl ; " , " ;y2 : 1 1 -
11 -H 12
470 BS = " DATA ■'
480 ZZ = 1
4 90 FOR I = 1 TO N
500 Nl = I - 1
510 IF ZZ < > 4 OR I = 1 THEN 570
520 ZZ = 1
530 PRINT 11; LEFTS (BSr LEPi (BS) - 1)
54U 11 = 11 + 12
5 50 B? = " DATA "
570 B? = BS + STR? (X(I)) + "." + STR5 (i^(I)) + "," +
STRS (P%(I) ) + " ,"
580 ZZ = ZZ + 1
590 REM CONT.
600 NEXT I
610 PRINT 11; LEFTS (BS, LEN (BS) - 1)
620 PRINT CHRS (4), -"CLOSE " ;AS
630 GOTO 84
640 REM CONT.
650 IF K < > 13 THEN 830: REM KEY IS
CR?
660 CALL - 1059: REM BEEP SPEAKER
670 N = N + 1:X(N} = AZ * X + BZ:Y(N) =
CZ • Y + DZ
680 IF F = THEN 810
690 IF G < > THEN 750
700 XDRAW 1 AT X,Y
710 G = 1: HPLOT X,Y:XZ = X:YZ = Y
720 P%(N) = 1
730 XDRAW 1 AT X ,Y
740 GOTO 800
750 XDRAW 1 AT X,Y
760 HPLOT XZ,YZ TO X,Y:XZ = X:YZ = Y
770 P%(N) =
780 XDRAW 1 AT X,Y
790 G = 1
800 REM CONT.
810 REM CONT.
820 GOTO 84
830 REM CONT.
840 REM CONT.
850 IF K < > 27 THEN 230
860 END
370 REM CURSER SUBROUTINE
880 X = PDL (0) * (279 / 255)
890 Y = 159 - ( PDL (1) * (159 / 255))
900 XP = AZ • X + BZiYP = CZ * Y + DZ
910 VTAB 22: HTAB 20: PRINT INT (XP t
.5) ;" ": VTAB
23; HTAB 20: PRINT INT {YP + .5) ;" " |
920 RETURN
1
No. 40 - September 1981
MICRO - The 6502/6809 Journal
APPLE BONUS
Software for the Apple II and Apple II Plus"^
BEITEATH APPLE DOS
A Technical Manual
By Don Worth and Pieler Lechner
Become an Mpertoti the inlricsciesotApple'sDOSIDisliOperatingSyslerrl. BENEATH
APPLE DOS 15 the perlecl companiod to Apple's DOS 3 3 Manual. Containing eighl
chapters, three appendites. a filossary. an iniJeii, and oner 160 pages, this maoiialwill
seree (o completely fill in Ihe many gaps left by Apple's DOS 3.3 Manual Wrillen for
Apple users ivith DOS 3 3. 3 2 or earlier versioni. any Apple disk user would welcome
hairing this carelully written manual al his fingertips.
LEARN
■ How DOS 3.3 differs from other DOS versions.
• How disks are protected.
• How lo reconstruct a damaged diskette CATALOG.
• How tracks are lormatted.
• How lo use the disk directly, wilhoul DOS.
• How lo call OOS's file manager
• How eveiy routine in DOS works
• How to customize DOS to your needs
• How to ouercome DISK I/O ERRORS
• About the "secrel" tile types — S and R
INCLUDES . .
• Large quantities of excellent diagrams and tables.
• Source listings ol useful disk utilities
• Glossary of over 150 technical terms
• Eihaustive description of DOS program logic.
• Handy reference card.
• Useful patches to DOS
• Many programming eiamples
Book - tl9.9S
CROSS-REF by lim Aalto
Applesoft programmers will be delighted to haye Ibis cross reference utility program in
their 'tool kit' ol software aids. What can CROSS-REF do to speed and facilitate your
Applesoft progiam development? Consider ttiese functions.
VARIABLE CROSS REFERENCE LINE CROSS REFERENCE
FIND VARIABLE FIND LINE NUMBER
REPLACE VARIABLE VARIABLE ONLY LISTING
LINE ONLY LISTING
Features that make CROSS-REF easy lo use include'
■ Written in machme language, occupies less than 3K.
• Resides passively in memory while DOS or Applesolt is active.
• Can be loaded witti your Applesolt program already resident
• Very last — a VARIABLE CROSS REFERENCE lota 16K Applesoft program can start
printing in 5 seconds
• Contains printer format controls and headers for documentation,
• Prints English language error messages.
Cassette - S77.9S Diskette - 124.95
LINKER by Don Worth.
Turn your Apple II or Apple II Plus into a powerful and productive
software development machine with this superb linking loader/editor
pacliage. LINKER does the toltowing and much more:
> Dynamically loads and relocates suitably prepared machine
language programs anywhere in RAM
> Combines a mam program with subroutines. You can assemble a
subroutine once and then use il with as many mam progtamsas you
wish.
• Produces a map ol all loaded routines, giving thew location and the
total length of the resulting module.
■ Containsa library ol subroutines includingbinarymultiplicationand
division, print teit strings, delay, tone generator, and random
number genefatot
Linker works with virtually any assembler for the Apple II. Requites 32K
ol RAM and one disk drive.
Diskette - S49.95
Hantial Only - J 19.95
FASTGAMMON" By Bob Christiansen.
Sound, hi res, color, and musical cartoons have
helped make this the most popular backgammon
playing game for the Apple II But don't lei these
enterlainmg features fool you — FASTGAMMON
plays serious backgammon Runs on any Apple H
with at least 24K ol RAM
CKSttte - J19.9S Disketis - 124.95
METEOROIDS IN SPACE"
3y Bruce Wallace
We have taken our popular space
game, lormerly called Asteroids in
Space, and made some important im-
provements To accenttheseimprove-
menis we have given it a new name —
METEOROIDS IN SPACE. Your space
ship travels through a shower of
deadly meleoroids, II your ship is hit. It
will be destroyed, so you use your laser
gun to blast Ihe meteoroids. Big
ireteOfOids shatter into smaller
rreleoroids when hit, and the smaller
nnes are usually iaster and lust as
deadly. From lime to time you will en-
counter an alien space ship whose
mission IS to destroy you, so you'd
belter destroy it Inst. All Ihe action is
displayed in last, smooth, high resolU'
lion graphics, accompanied by sound ellects. You now can control your ship using one
ol two options — the Apple game paddles or the keyboard One ol the game paddle
buttons controls the laser tire. In METEOROIDS IN SPACE, the spaceship's velocity
gradually decreases unless more thrust is applied, adding an element of control Also
new lo this version is a hyperspace feature — translate instantly to another spot in Ihe
galaxy The game is over when five of your ships have been destroyed. An additional
shipisadded lor every lO.OOQ points you score Runs on any Apple II with alleast32K
ol RAM and one disk drive.
Diskette -119.95
ASTROAPPLC" by Bob Male.
Tour Apple computet becomes your astrologer,
generating horoscopes and lorecasls based on the
computed positions ol the heavenly bodies. This
program oilers a deligtttlul and stimulating way to
entertain Iriends. ASTROAPPLE produces natal
tioroscopes | birth charts) for each person based
on his or her tirth data. Any two people may be
compared for physical, emotional, and intellectual
compatibility. The program is written in Applesoft
BASIC with machine language subroutines. II
requires either RAM or ROM Applesolt and al least
32 K of memory.
Cassette - tlt.35 Oiskatte - 119.95
FRACAS" by Sluart Smith.
A fantastic adventure game like no other! Up lo eight
players can participate in FRACAS at the same time.
Journey in Ihe land ol FAROPH. searching for hidden
treasure while warding off ail sorts ol unfriendly and
dangerous creatures You and your friends can compete
with each olhei or you can |oin forces and gang up on the
irs. Your location is presented graphically and sound
(vv=i " elleclsenliven thebattles.Save youradventureondiskelte
i,„ii.~i-i '"'"^E' or cassette and continue it at some other time. Both integer
„^.:.-u ; ^^-V BASIC and Applesolt versions included. Requires at least
"•'IfWl^L ''-^' "'"i ^"^1'
feji^tCar-^ .^j^ monsters.'
f --" ■* - .jv*< elfecis enl
iiciii'iiimjl'
32K ol RAM.
Cissett* - 119-95 Diskette - 124.95
BATTLESHIP COMMANDER" by Erik Kilk and Matthew Jew
A came of strategy. You and the computer each slart out by positioning fue ships ol
diifereot sizes on a ten by ten grid.Then Ihe shooting starts. Place your volleys skilllully
— a combination ol logic and luck are required to beat the computer. Cartoons show
Ihe ships sinking and announce the winner. Sound effects and flashing lights also add
lo Ihe enioymenlot Ihe game. Both Applesoft and integer BASIC versions are included.
Requires at least 32K of RAM.
Cassetle- 114.95 Diskette - $19.95
Also by Don Worth
BENEATH APPLE MANOR - Adventure. Uses Integer BASIC.
Cassette - tl4.95 Diskellc - 119.95
BABBLE - Fun with words, sound, and graphics.
Cassette - $19,95 Diskette - 124.95
fSfS Qu;iLrTy softw7ir€
L^^JbJ 6660I5esedaBlvd., Suite 105, Resedo.CA 91335
VBb* (213) 344-6599
Now exclusive distributors for products from The Software Factory. Kewhall, California
'Apple II and Apple 11 Plu; ne trademarks pl Apple Com purer. Inc
WHERE TO GET II: Call us at [213) 344-6599 lor the name of the Quality Software
dealer nearest you. II necessary you may order direcfiy from us. Mastercard and
Visa cardholders may place orders by telephone. Or mail your check or bantcard
number to Quality Soltware, 6SG0 Reseda Blvd.. Suite 105. Reseda, CA 91335.
Calilornia residents add 6% sales tai. SHIPPING CHARGES: Within North America
orders must include 11.50 lor first class shipping and handling Outside North
Ameiica the charge lor airmail shipping and handling is J5.0O. Pay m U.S.
currency.
70
MICRO - The 6502/6809 Journal
No. 40 - September 1981
APPLE BONUS
True 3-D Images
on Apple II
This article describes a program
which creates stereo-pair
images for viewing without
accessory devices. The pair of
images can be fused into a
three dimensional pattern by
placing a piece of paper
between the viewer's eyes and
the viewing screen so that each
eye sees only the appropriate
image. With practice the paper
is no longer needed. The object
used for demonstration is a
three dimensional Lissajous
figure.
Art Radcliffe
1612 Ferndaie
Ann Arbor, Michigan 48104
What we are talking about here is a gen-
uine three-dimensional image such as
seen through my grandparents' stereop-
tican or through more recent systems,
such as require colored eye filters or
polarizing filters for viewing. The pres-
ent technique involves not a single pro-
jection of the object, a perspective view,
but a pair of images which can be fused
into one 3-D image without auxiliary
contrivances.
The Scientific Ameiican has pub-
lished articles accompanied by stereo-
pair images, which can be fused into a
stereo scene with a little practice. This
program was inspired by success with
such viewing. Some eye training is re-
quired, and some eye strain may be felt
initially. What is required is that you
stare off into the distance (eyeball axes
essentially parallell while focussing
nearby. The muscles which direct your
eyeball and the muscles which focus
your lens are accustomed to working in
a coordinated way for distant or for near-
by objects; this muscular habit can
readily be broken. It is not at all difficult
for me now to glance at a pair of images
on the screen from anywhere in the
room, and see the 3-D partem.
Listing 1
REW HOISY" COAS'i'EK BV Ai^l' KAUXit'fE
10 HCME : PCS<E 36,12: PRIMT "NOISY CCASVER"
20 DIM A%(299): DIM B%(299): DIM H%{299): DIM S(299) |
30A = B = C = D = E = F = G = H = I
= J =
40K = L = M = N = = P = Q = T = U
= V =
50W = X = Y=Z = 0:R = - 16336:S =
.5:LL =
60 GOTO 630
bD KePI '
70 PRINT CHE$ (7): PRIWr CHR$ (7):
FOB A = TO
1000:
KECr : PRIHT CHRS (7)
80 PDR P = TO 299
90 A = PKI-K {R)
100 ECOlOtf^ 3: REM FFCWT OF TRAIN
110 B - A%CP):C = B%(P):D = H%(P)
120 E - B -H 1:F = C + 1:G = D ■•■ 1
130 HPLCfT B,F: HPLOT E,C: HPICfT E,F
140 HPLOT D,F: HPLOT G,C: HPLOT G,F
150 Q = P - 10
160 A - PKKK (R)
170 IF Q < THEM Q = P + 289: REM
<=Q<=360DEG
180 HOOLCa*^ 0: REM END OF TRAIN
190 B = A%<Q):C = B%(Q):D = H%(Q)
200 E = B + 1:F ^ C + 1:G = D + 1
210 HPLOT B,F: HPLOT E,C: HPLOT" E,F
220 HPLOT D,F: HPLOT G,C: HPIi^T G,F
230 A = PEEK (R) : REM REPUOT TRACK -
>
240 HCOLOI^ 3: HPLOT B,C: HPIJOT D,C
250 A = PFEK (R)
260 FOR Z = TO LL - B%{P) : NEXT :
REM TRAIN SPKFTl |
270 A = PKHIK (R)
280 NEJCT P
290 PRINT CHR$ (7)
300 Rh'lUKN
JUj KcM ^^
310 FOR P = TO 299: REM EffTABLISH
PAriTiRK
320 X = S(I) + L:Y - 2 * S(J} + T:Z =
S(K)
330 M = (C - Z) / (G - Z)
340 A = IMT (S -H X + M * (E - X)):A%{P) - A: REM
T,KhT X
350 B - INT (S -f Y -h M * (F - Y) ) -
50:B%(P) - B
REN Y
360 H = IHT (S -t- X -I- M * (D - X)):H%(P) = H: REN
RICTft X
370 HPUrr A,B: HPLOT A + 2,B: HPLOT
H,B: HPLOT" H
+ 2,B
380 IF LL < B TWEM LL = B
390 I = I-hU:IFI> 299 ■fflEN 1 =
400 J = J ■^ V: IF J > 299 THEN J =
410 K = K -I- W: IF K > 299 THEM K =
420 NEXT P
430 KE^IURN
(Continued)
No. 40 - September 1931
MICRO - The 6502/6809 Journal
71
APPLE BONUS
The viewing images are produced by
running rays from each defined point of
the object to points which correspond to
eye locations, with the obiect being
behind the screen and the eyes in typical
viewing positions. Points are plotted
where these rays intercept the display
plane.
The object is defined near the origin
of an X, Y, Z coordinate system, behind
the screen plane. We can define object
points using the notation: (Xl.Yl.Zl),
define screen points with: {X2,Y2,Z2)
and define the eye locations using:
(X3.Y3.Z3). Z2, the screen distance
from the origin, is set at 200 in the pro-
gram and 2^, the eye distance from the
origin, is set at 300. Y3 is the same for
each eye: 40; and the X3 values for the
two eyes are 40 and 120. The direction
from which the object is viewed can be
altered by offsetting XI and Yl .
Use of proportions leads us to the
conclusion that IX2-X1)/(Z2-Z1) =
IX3-X1)/{Z3-Z1) and similarly, (Y2-Y1)/
fZ2-Zl)= IY3-Y1I/{Z3-Z1). From these
equations we can derive X2 = X1 +
M(X3-X1) and Y2+Yl-<r MIY3-Y1J
where M = (Z2-Zl}/fZ3-Zl).
Listing 1 is an embellishment, with
soimd effects, of the program as originally
written, which appears in listing 2.
Within the program there are
variable substitutions: (X,Y,Z] =
(Xl,Yl.Zlj. iA,B,C] = (X2,Y2.Z2) and
iD,F,G),lE,¥,Q] = IX3.Y3,Z3). A Ussa-
jous pattern was chosen for viewing
because it has the convenient property
of being restricted to a rectangular aiea,
derived from the property of the sine
ftmction, being bounded by 1 and - 1. In
the program a raised sine is used by ad-
ding 1 (line 64] to avoid negative values.
Thus, the X-coordinates of the object
vary according to one sine function, the
Y-coordinates of the object vary in a
coordinated manner according to a sec-
ond sine function, and the Z-coordinate
varies according to a third sine function.
Random numbers are used to
achieve an almost infinite variety of pat-
terns. It is fun to watch the pattern take
shape; the eye can go on a toller- coaster
ride with the leading edge of the pattern
as it develops on the screen.
There is an inherent limitation to
this method in that the display area is
limited to the space between the
primary pair of images. Use of prismatic
glasses might increase the available ob-
ject size. The program is written for
viewing on a twelve inch diagonal
screen. Users with other size displays
may want to alter program parameters,
first increasing or decreasing the X
dimension for eye position by altering
Listing 1 (Continued)
435 REM
440 O = 8 * NTS (1) / 300: Sm 360DEG/3O0
450 N = 40: REM OBJECT SCALE FNJFOR
460 FOR A = TO 299
470 S(A) = N
480 NEXT A
200:
E
F
L
T
G
490 C
500 D
510
520
530
540
550
560 U
570 V
580 W
580
590
600
610 K
620
625
630
* (1 + SIN (A * O)): BH^ SISEH>0
R01 X CCOR'S OF EYES
120
40: KH1 Y COOB'S OF EYES
40
150: REM X,Y,Z GOCK'S OF OBJECT
250
300:
IMT
INT
INT
REM # CYCLES IN X,Y,Z ->
(1 -I- 5 * RHD (1))
* RHD (1)): IF V = THBl 570
* RBD (1)): IFW = V0RW = U THEN
(1 +
(1 +
I
J
IMT
INT
INT
RETURN
REM
(300
(300
(300
FMD (D):
RND (1))
RND (D)
REM STRRT POIOTS
PRIWF : PRINT : PRINT " CREAIED BY ART RADCLIFEE,
ANN ARBOR ": PRIKT
640 PRINT ! PRIMT "PIACE 8 INCH BY 12 UKH CARIBOARD
650 PRINT "BEnWEEM SCBEH) AND TIP OF NOSE SO EACH
660 PRINT "EYE SEES CKLY IT'S IMflGE. SCME EYE
670 PRINT "TBfilHIMG IS NECESSARY.
680 PRIHr : PBIWr : PRINT : PRINT : PRINT
PRINT "PIEASE BE PftTTrarP WHIIE I MEDITATE TO
raiNT "GET MYSELF READY FOR THIS
690
700
705 REM
710 GOSUB 440 REW INITIALIZE
720 HCME : tJGR : HCOLO!*^ 3
730 LL = 0: REM LOWEST POINT
740 GOSOB 310 REM LAY TRACK
750 FOR A = TO 999: NEXT
760 GOSUB 70 REM HCffC TICaTTl
770 FDR A = TO 3000: NEXT
780 GOSUB 490 RH^ REINITIALIZE
790 GOTO 720 REW START OVER
800 END
Listing 2
Bm LISSAJOUS FIGURES IN TRUE 3D FOR APPI£-II.
PLEASE SHARE YOUR CCMMEHTS WITO:
ART RADCLIFFE
1612 FERMDALE
ANN ARBOR, MICHIGAN 48104
(313I-995-2485
SEE REMARKS AT EMD OF PROGRAM.
: HCOLOR^ 3: PRINT : PRIWP : PRINT "WAIT"
2 REW
4 REW
6 REW
8 REW
10 REM
12 REM
14 HGR
16 DIM S(199)
18A = B = C = D = E
20J=K=L=M=K
22 GOTO 56
24 FOB P = TO 199
26 X = S(I) + L
28 Y = S(J) + T
S(K)
(C - Z) /
INT (S -I-
IHT {S -t-
im is +
= G = H = I =
= P = X = Y =
S =.0
Z =
30 Z
32 M
34 A
36 B
38 R
(G - Z)
X -^ M *
Y + K *
X -I- M •
(E - X))
{F - Y))
(D - X))
40 HPLOT A,B: HPLOT H,B
IContinued)
72
MICRO -The 6502/6809 Journal
No, 40 - September 1981
APPLE BONUS
Listing 2 (Continuedl
42 I = I + U: IF
I
> "199 THQJ 1 =
44 J = J + V: IF
J
> 199 THEN J =
46 K = K + W: IF
K
> 199 THEN K =
48 NEXT P
50 FDR Z =
TO
5000: NEXT Z
52 HGR
54 GOTD 22
56 = .04 * ATO <1)
58 N = 40
60 FOR A =
ID
199
62 B = A *
64 S(A) = N
* (1
+
SIH (B))
66 NEXT A
68 C = 200
70 D = 120
72 E = 40
74 F = 40
76 G = 300
78 T = 250
80 L = 150
82 u = i»r
(1 +
5
• rajD (1))
84 V = iwr
(1 +
5
* FMD (1)): IF V = U THEM 84
86 W = TUfT
(1 +
5
* HMD (1)): IF W = V OR W = U THEM 86
88 I = MT
(199
*
FKD (1))
90 J = TSr
(199
•
RND (1))
92 K = INT
(199
*
EMD (1))
94 S = .5
96 PC*(E 49234,0
98 GOTD 24
100 REM TO VIEW,
SIT Wrm FACE ABOUT A TOOT IN FWtfF OF T
SCREIK AND STARE THKOUO^ THE SCREEN OFF IWTO THE DISTAtKE.
102 REM THIS PRCXSiAM PLOTS A LEET-EYE IMAGE RND A BIGRT-EYE
IMAGE WHICH MUST BE FUSED IWID A SIWXE IMAGE.
104 REM THIS TAKES PRACTICE, AS THE EVES ARE POUTTED OFF IHT
O THE DISTftHCE WHILE THEY ARE FDCUSSED CK THE SCREHJ.
106 REM WHEN THE IMAGES ARE FUSED YOU WHISEE A THREE DIMENS
ICMRL PATTERN IN THE CEKTER WITO IREEIE^'SOT' IMAGES CN EACH SICE.
108 REM IN TIME VOU WILL BE ABLE TO GLANCE AT THE SCREHI FRO
M MsiYHERE IN THE ROCW AND SEE A 3-D IM«3E.
110 REM PAY ATTEWriCH TO YOJR EYES; QUIT IF THEY FEEL STRAIN
ED.
112 REM THE PRCGRflM GENERATES A 3-D PATTEE*! BEHIND THE SCREE
N AND RUNS A RAY FRCM EACH POINT CH TOE PATTERN TO EACH OF YOUR
EVES IN FBCWT OP THE SCREEN.
114 REM AT THE POINT WHERE EACH RAY DJTERCEPTS THE SCREEN A
POIWT IS PICITED.
116 REM THIS IS A SIMPLE MATTER OF PROPOifTICNS ; YOU MAY READ
UP CM IT IN AN OPTICS TEDCT. YOU KIGIT ALSO READ CN DIRECTION C
OSINES IN A SOLID MJALYTIC GEOMETRY TEXT
118 REM CBJECr IS AT ORIGIN; OBJECT IS ORIGINAIX.Y DEFINED WI
TH {X1,Y1,Z1) AND IS REPRESENTED IN PROGRAM BY (X,Y,Z).
120 SIMILARLY EDR THESCREENPIANE : ( X2 , Y2 , Z2 ) AND (A,B,C)
122 REM EYE LCCATICNS ORIGINALLY DEETNED BY (X3,Y3,Z3) AND B
Y (D,F,G) AND (E,F,G)lN PROGRAM.
124 REM THE OBJECT IS VIEWED FRCM OFFSET POIHr DEFINED BY TAND
L.
126 REM THE ceJECT IS CREATED BY DEFINIM3 THE X, Y, AND Z C
OORDINATTS BY THREE SEPARATE SINE FUI«:TICMS.
128 REM THE POIHTS ARE PLOTTED AT AM3ULAR INCREMENTS SET BY
■O', LINE 56.
130 REM THE PROC3WM IS SPEEDED BY PRECALOJIATIN A SINE TABL
E WITH SCALE FACTOR 'N' BUILT IN: LINES 60-66.
132 REM I, J, AND K START THE THREE SINE RMCTICBS AT RAKECM
HJASES IN THE SINE TABLE.
134 REM U, V, AND W ARE a^ALL INTEGERS WHICH ESEFINE THE PERI
OD (OR FREQUENCY) OF THE SINE EUNCTIOTS.
one or both of parameters D and E. It
may also be useful to alter the scale fac-
tor N.
Interesting 3-D motion displays
could be written in machine language; I
can also imagine game possibilities, in-
cluding visual 3-D Tic Tac Toe- Please
note the remarks appended to the pro-
gram [written in Applesoft], which com-
plement the explanatory remarks above.
1 have experimented with more
general systems using color filters for
viewing, and may report on this at some
future time. I hope that readers will
experiment with this viewing system,
perhaps altering parameters of the given
program or substituting another object.
Data points in three dimensions might
be seen as a 3-D swarm of points in
which local clusters or correlations
could be detected. This is a new way of
seeing things.
Art Radciiffe has worked 25 years for
IT&T, Radiation -Inc., and Burroughs,
during which time he has acquired 32
patents in computer and communciation
circuits and systems. He has also worked
in optics and holography, whence his
interest in generating 3-D images. He has
a 48K Apple with twin disks. Zenith color
monitor and Silentype printer which he
uses as a medium for creative and artistic
expression.
JUC(K>
Need o solution for
Floppy Disk Lube
Just THR€€ drops con:
• Prolong useful dish life.
• Increase head life.
• flilouj InitiolizatJon of "problem"
disks.
• Save 'unbootQble' dishs.
• Reduce 'gljtching' problems.
• Cut nuisonce problems.
FLOfW DISK LLffle - '/; o^.
UIITH nPPUCFITOfl.
$4.00
Odd t! 50 shipping ond hondling. Ohio
lestdents odd S'/i% soles tax.
DOSUJBRe.lNC.
No, 40 -September 1981
MICRO - The 6502/6809 Journal
73
LOGICAL SOFTWARE, INC.
announces:
MAIL EXPRESS
A NEW MAIL LIST UTILITY FOR THE APPLE II,
— Up to 2,200 Names per File
— Sort by Company Name, Customer Name,
City, State Zip
— Prints Return Addresses
— Merge up to 16 Files
— Easy User Definable Codes for City, State and
Zip to Save Time and Disk Space
This is an easy to use professional quality mail
list able to handle large or small tiles.
Introductory Price 549.95
52.00 Postage & Handling
Logical Software, Inc.
P.O. Box 354
Farmington, Ml 48024
(313) 477-2565
® Apple and Apple II are registered
Irademarto ol Apple Compuler lnc J
LISP
for the Apple II
Pegasys Systems' new P-LISP interpreter is a full im-
plemenlation of the well-known Artificial Intelli-
gence language. Written in mathine code, this
powerful interpreter includes the following features:
• Over 55 funclions implemenled
• Extensive 45-pjge User Manual
• Full funclion Irate
• Fail, effitienl Garbage Colletlor
• Supplied with funclion pdilor and pretlv- printer
• Runs in 32 or 48K Apple II or II + wilh disk
• ELIZA and other sample programs included
• Special language card version provided
P-LISP is supplied on disk with User Manual for
$99.95. The manual is available separately for
$10.00. Piease specify DOS 3.2 or 3.3.
PEGASYS SYSTEMS, INC.
4005 Chestnut Street
Philadelphia, PA 19104
Orders only: 800-523-0725
PA residents and inquiries: (215) 387-1500
A|jpl*f 15 J (rjdem^irk ril A|)|jU' Ojirtpulfr Ini
Good software is no longer a myth.
DOUBLE DOS PLUS
for Apple Computers
^1-839-3478
OTHER UNIQUE PRODUCTS FROM MtCRO-WARE DISTRIBUTINQ INC.
DOUBLE DOS Plus— a piggyback boaccf that plugs into the
disk-controller card so that you can switch select between
DOS 3.2 and DOS 3.3. Works wilti the language system elimi-
nating the need in many cases to boot the BASICS disk. Also
eliminates the chore of converting all of your 3.2 disks to 3.3
NOTE" APPLE IS a registered trademark ol APPLE Computer, Inc., Cuperlmo. CA.
WHY IS DOUBLE DOS PLus better?
• Nothing needs to be soldered, jus! plug in and go,
• Since all four ROMS are used, all software will work,
even early 3.1 DOS.
• Because the ROMS fit on the back of the board, it has
ttie Ihinnest configuration allowing full use of slot #7
• One set of ROMS is powered up at a time, thus saving
power. DOUBLE DOS PIus rsquirss APPLE DOS ROMS
• Full 90-day warranty from TYMAC.
MICRO-WARE DISTRIBUTING INC.
P.O. BOX 113
POMPTON PLAINS, N.J. 07444
THE APPLE CARD— Two sided 100% plaslic le'erence card lor |he Apple comouler
Loaded wiTh inlormaliiyi ol inleresi ta all Apple owners 13 98
PARALLEL PRINTER CARD— PPC 1 00— A Umvefsel CenifonicS Fype paia^rek prmiei
board compJere wilh cat>l« and con nsc [or This urtiquE board allows you lolurnon and oil
I he high bii so FJial you can access additional Faalures in many prrniers U&e with E^SON,
ANAOEX, STAR WRITER. NEC, SANDERS, OKk and olher wiin slandarfl Cenironic?
conliguraiion ^ /"T^ Si 39 00
'i — .Si*^-
i| i;^^—
H" ' ' "ijir
THE DOUBLE BOOTER ROM— Plugs in(o Ihe empty Ofl Sockel on the Appfe morhei
boara 0' ihe integer ROM Card to provide a i3seclof dool wilhoul jsing Ihe BASICS Dish
DoubleBooter may also be used m [he MOUNTAIN HARDWARE ROM PLUS board This
chip will not work in a plus machine unless rl contains an Integer bsard or a ROM Plus
hoafd $25 00
DISK STIK— Contains 10 dozen disl^elle labels ^iitli eilher 3 3 Or 3 2 (JesignaliDn Room
for program rigmes and lype also $3 9S
Aftftitik-ik****** SOFTWARE ************
SUPER SEA WAR—Hires Dallies hip type simulalFon Si 3 95
ULTIMATE JCFtR — A telephone sflllware iransler program, uses DC Hayes Assoc
micromodem S25 00
ROADRALLVE-Hiresdnuinggame with 5 diderent lull screen iracks 115 00
MISSILE CHALLENGER — 'Hires arcade lype game where you delend your cities I rem
1 ailing missiles aievelsawriieanameanighscore lodisk S19 95
SUPER PIX— Hires screen dump loi Ihe EPSON ^«K SO, inverse oi normal, larger than lull
page graphics m 2 orienralions. Needs Tymac PPC-100 Printer board or we will upgrade
your EPSON boarO (or $35 S39.95
GRAPH -FIT — A hires graphing program Thai produces ba^ charls, pie charts and line
graphs HasauloscaJmglealureloo £25 00
iSTILL MORE APPLE GOODIESi
APPLE KEYBOiHO SyNTHESL7EJl— 49 nole IC lo C| AGO KeyBoard *rth 3 sawWoin so wave
shapQis. 3 audio osciratojs. 3 low pass lilTeis, i-&4 pcHnI shape conlrollers. 2 enveJope
aeneralQJS Comptele sv^l^i" , £995
KEYBOARDONL¥*r(hApclBliilsrface ..... SS'B
OBAPHICNOTEWniTEB— HFesndlewfilororsynlhesiiOTsysWiii '. $99
SUPER PiX OKI— Hires screen dump lot OKI Microline BO, 62, 83 Pfinlaifl Seme leeture? as
Bupefpin Needs TymacPPC-IOOBoafd $24 S5
NIBBLES AWAY— The DesT rjisli back up progfam lo dale Alkme you lo make backups ol rroal
everydi&hever produced lor Ihe Apple, Over 1 user delirtad paramelers including syrtchrortized
& unsynchionized copies a3 well eeauEOfnahc hall IrachingaTLd raw dale Iransler. . . £59
Call 201 -839-3476 lor Dealer a Dislfibuloi Inquiries
74
MICRO - The 6502/6809 Journal
No- 40 - September 1981
i
APPLE BONUS W
Apple Bits, Part I
This article describes several
aids to faster and more efficient
low resolution grapiiics
programming, Including machine
language routines.
Richard C. Vile, Jr,
3467 Yellowstone Dr.
Ann Arbor, Michigan 48105
This is the first in a series of articles
deahng with the use of the Apple II low
resolution graphics features. Some
techniques will be described that use
machine language to enhance the speed
of graphics applications and reduce the
amount of memory required in order to
represent certain screen patterns.
The basic techniques to be described
will enable display of patterns, each of
which is 8 x 8 in size or smaller and
consists of a single color. Larger patterns
must be constructed from smaller pieces
which fit these requirements, A
modification of the machine language
routine will allow multiple colors to be
obtained by overlaying.
This article wUl describe the ma-
chine language display program which
converts a numericaiiy encoded picture
into the low resolution display pattern.
The next article will describe an Integer
BASIC program which allows the user to
interactively develop a series of pat-
terns, store their corresponding numer-
ical representations in memory, and save
it all on disk or tape. Finally, each arti-
cle in the series will present one or more
applications of the techniques to the
construction of animations in Lo-Res.
Bit-encoding a Picture
Consider the following eight hex-
adecimal numbers:
38,38, 12, FE,90, 28,44,83
Believe it or not, they contain a picture!
To see how, let's first rewrite the
numbers in binary, using the following
table to convert each hex digit into a
4-bit binary "nibble:"
Hci
Binary
0000
1
0001
2
0010
3
0011
4
0100
5
0101
6
QUO
7
0111
8
1000
9
1001
A
1010
B
1011
C
1100
D
1101
E
1110
F
nil
We arrive at the following numbers:
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Do you see the picture yet? Just in
case you don't, let's transform the pat-
tern of O's and I's onto "graph paper" by
superimposing a grid of squares on top of
the above list, like so:
3
1
1
1
D
1
1
1
3
1
1
1
1
1
1
1
1
1
L
1
3
1
1
D
1
1
L
1
1
Now, erase all the O's and complete-
ly blacken the squares containing the
I's. That gives the grid shown next:
Now, of course, you see the "pic-
ture." Erasing the grid lines should
make the correspondence with the Lo-
Res display pretty obvious as well. The
question now becomes: "How do we
turn the above process into a program?"
Shown in listing 1 is a machine
language program which will carry out
the process. It "assumes" that certain
information has been set up for it. This
information will be illustrated by listing
2 (in Integer BASIC), We discuss this
ftuther following that program.
No. 40 - September 1981
MICRO - The 6502/6809 Journal
75
APPLE BONUS
Listing 1
*80ALL
080A-
A5
30
LDA
530
080C-
811
04
08
STA
J0S04
030F-
AC
00
08
LDY
$0800
0812-
SC
03
08
STY
toao3
0815-
CE
03
08
DEC
J0803
0818-
30
31
BHI
$0846
081A-
AE
01
08
LBX
$0801
08111-
BE
02
08
STX
$0802
0820-
CA
HEX
0821-
30
F2
BMI
«0815
0823-
en
50
08
LIiA
ii}BZO,X
0826-
AC
03
08
LI'Y
$0803
0829-
31
3C
A Nil
( »3C >.Y
082E1-
no
04
BNE
$0831
082II-
A9
00
LPA
#$00
082F-
85
30
STA
$30
0831-
A5
24
LDA
$24
0833-
18
CLC
0834-
6ti
03
08
ADC
$0803
0837-
AS
TAY
0838-
A5
25
LDA
*25
083fi-
8E
02
08
STX
$0802
083ri-
6D
02
08
ADC
$0802
0840-
20
00
FS
JSR
$F800
0843-
AD
04
08
LDA
$0804
0846-
85
30
STA
$30
0848-
AC
20
08
.J MP
$0820
034B-
60
RTS
084C-
80
?■?'.■
08411-
10
10
BPL
t085F
084F-
F8
SED
0850-
01
02
OR A
( $02iX )
0352-
04
???
0853-
08
PHP
0854-
10
20
PPL
$0376
0856-
40
RTI
0857-
80
???
0858-
Aa
TAY
0859-
BO
OS
Bc;i
40363
oasB-
28
PLP
*
Machine Language Pattern D is player
Listing 2
10 GR ; PRINT : PRINT ! PRINT
12 POKE 2043,7: POKE 2049.7
15 R0U=7+ RND ( 27 )
20 C0L=7+ RND (27 )
25 C0LOR= RND ( 15 HI
28 POKE 36fC0Lt POKE 37rR0W
30 FOR .J=l TO RND < 10 )
40 SPARK=1+ RND < 20 )
50 0FFSET=SPARK*7
60 POKE 60r< 3072+OFFSET) MOD 256
65 POKE 61,( 3072+OFFSET )/256
70 CALL 2058
72 FOR DE=1 TO RND (25): NEXT DE
75 NEXT J
80 COLOR=0: FOR J=0 TO 6; HLIN COL»
COL+6 AT ROU+J: NEXT J
85 GOTO 15
Integer BASIC Fireworks Animation
The BASIC program does a series of
POKEs which set up the machine
language routine's infoimation:
12 POKE 2048,7: POKE 2049,7
indicates the width and height of the
patterns to be displayed.
28 POKE 36,C0L: POKE 37,ROW
indicates the ROW and COLUMN of the
Lo-Res screen at which the upper-left cor-
ner of the pattem to be displayed will be.
60 POKE 60,(3072 + OFFSET)
MOD 256
65 POKE 61,(3072 + OFFSET)
/256
stores the address in Apple 11 RAM at
which the numerical codes for the pat-
tem to be displayed begin.
The machine language program is in-
voked by the line:
70 CALL 2058
Running the Fireworks Animation
The numerical data which the pro-
gram uses must first be entered into
memory. This data resides at locations
COO to D27 13072-33671 and has been
listed on the next page. Once you have
entered it (sorry about that] using the
monitor, save it on tape (C0O.D27W] or
on disk:
*3D0G
> BSAVE SPARKS,A$C0O,L$1 27
to avoid keying it in again later.
Likewise, enter the machine language
program using the monitor or the mini-
assembler and save it:
•800.857W (Tape]
or
*3D0G
>BSAVE APPLE-BITS,
A$800,L$57 (Disk)
(Continued)
76
MICRO - The 6502/6809 Journal
No. 40 -September 1981
In order to run the program, you
should issue the command;
>LOMEM:4096
so that BASIC doesn't clobber the
machine language program.
Assuming you are using a disk-based
system, the entire sequence of com-
mands needed to run the animation
would be:
>BLOAD APPLE-BITS
>BLOAD SPARKS
>LOMEM:4096
>RUN FIREWORKS
I If you hate keying in long command se-
quences, cook up an EXEC file with the
commands in it.]
Numerical Data for Fireworks Animation
*C00.ri27
ocoo-
FF
FF
FF
15
IF
15
F5
00
OC08-
00
00
08
OO
00
00
00
00
ocio-
14
00
14
00
00
00
22
00
0Ci3-
00
00
22
00
41
00
00
00
OC20-'
00
00
41
00
00
14
08
14
0C28-
00
00
00
nn
14
00
14
22
OC30-
00
41
2:.'
00
00
00
22
41
0C38-
00
-in
14
08
14
22
00
41
0C4C-
22
14
00
14
22
41
41
22
0C43-
14
03
14
22
41
00
00
00
OC50-
08
00
00
00
00
00
08
14
0C58-
08
00
00
00
08
00
22
ini
OCAO-
08
00
08
00
00
41
00
00
0C68-
08
00
00
08
IC
08
00
00
OC/O-
00
08
08
3i
08
0!.!
00
08
0C7S'
08
00
63
00
03
08
00
08
OC80-
08
3E
08
08
00
08
08
08
0CB8-
7"7
03
08
08
08
08
OS
7F
0C90-
08
08
08
12
IF
10
19
15
0C98-
12
11
15
OA
06
IF
04
17
OCAO-
15
09
IF
15
ID
19
05
03
(1CA8-
OA
15
OA
17
15
IF
00
OA
OCBO-
00
10
lA
00
FF
FF
FF
OA
0CE8~
OA
OA
FF
FF
FF
01
15
07
OCCO-
FF
FF
FF
IF
05
IF
IF
15
occ:a -
OA
IF
11
11
IF
11
OE
IF
ocno-
15
11
IF
05
01
IF
11
19
ocns -
IF
04
IF
11
IF
11
18
11
OCEO-
IF
IF
06
19
IF
10
10
IF
OCEB -
02
IF
IF
OE
IF
IF
11
IF
OCFO-
IF
05
07
IF
11
17
IF
05
0CF3
lA
17
15
ID
01
IF
01
IF
ODOO-
10
IF
OF
10
OF
IF
08
IF
oooa-
IB
04
in
03
IC
03
19
15
OIMO-
1/1
FF
FF
FF
FF
FF
FF
00
0D18-
11
IF
FF
FF
FF
FF
FF
FF
ori2ti -
FF
FF
FF
FF
FF
FF
FF
FF
iUCftO
Just Published!
What's Where in the Apple?
An Atlas to the Apple Computer
By William F. Luebbert
Adjunct Professor of Engineering, Dartmouth College
The MOST DETAILED description to date o1 Apple II Firmware
and Hardware-
• This Atlas and Gazetteer of PEEKs, POKEs, and CALLs lists
in tabular form over 2000 memory locations.
• Information is presented numerically in the Atlas, and alphabetically
in the Gazetteer.
• The names and locations of various Monitor, DOS, Integer BASIC,
and Applesoft routines are listed, and information is provided on
their use.
• The easy-to-use format includes:
The address in hexadecimal (useful for assembly
programming): $FC58
The address in signed decimal (useful for BASIC
programming): < - 93 6 )
The common name of the address or routine: Chome]
information on the use and type of routine: \SE\
A description of the routine: CLEAR SCROLL WINDOW
TO BLANKS. SET CURSOR
TO TOP LEFT CORNER
• Related register information: {A- Y-REGS ALTERED)
This reference tool offers Information every serious Apple user
needs. BASIC and assembly language users alike will find the
book helpful in understanding the Apple.
128pages,8V2 x 11 inches, cardstock cover, Wire-0 binding. $14.95*
Ask your computer store for What's Wtiere in the Apple or call
800-22M617 Ext. 564
!n California call 800-772-3545 Ext. 564
■y
24-Hour Toll-free Service VISA and Mastercard Accepted
34 Chelmsford Street, P.O. Box 6502, Chelmsford, MA 01824
'Add $2.00 for surface shipping, Massacliusetts residents add 5% sales tax.
No. 40 - September19S1
MICRO -Tfie 6502^809 Journal
77
INVEST
with
CREATIVE FINANCI
by HowardSoft
Get an Edge with CREATIVE FINANCING:
This sophisticated but friendly software clears ttie log
created bv today's creotive loan packages, complex
lox laws, runowav inflatiori. and cash-diainmg invest-
ments Whether you invest in bonds, slocks, income
property, or trust deeds, or you just want to determine tie
true cosi ol vour txxne rrrortgage or consumer loon, this
package will aid you in intelligent dec is ion -ma king.
Realistically see the direct impoct ot inflation, time
value ol moriey, taxes, ond cash flow timing, and play
"what if" wilti tfe confidence ttial all importont factors
are properly handled If is now possible in jusl o tew
minutes to ob|ectively compare dissimilar loans and m^
vestments with the realism formerly achieved only by
the lew tinonciQl wizords who could complete analyses
ol tliis t/pe in a lew hours. This package is INDISPENSIBLE
FOR ANVONE WHO INVESTS WITH BORROWED tvlONEY
NOW AT YOUR DEALER FOR $150.
Also ask about our Tax Preparer
and Real Estate Analyzer software.
Howard Software Services
for the SERIOUS Personal Compulei Usei
6713 Vista del tvlai j La Jolla CA 92037 | (714)4M-5079
■J : ■ . ,
Tactical Prlhtouls tor Infelligent Decisions:
■ '■ fvlonthly interest & principal poymenf scttedules for
" complex loan pockoges - multiple trust deeds,
wraparounds, amortization, interesf only, variable
interest rot^, deloyed payments, balloons, re-
botes, mid-y^Or starts, add-on interest, simple
interest
■ Annuol depreciation sctiedules for complex compo-
nent depreciation - stroight line, sum of year's
digit, declining balance, autcmotic conversion to
strolght line, tax credits, recopture ol excess
depreciation
■ Tabulor projections ol year-end on-sale profits — inter-
nal rote of return, return on investment, return on
prior year's equity, net present volue, future value.
• Tobular ptoiections ol cash tlows - debt setvice, tax
credils, leases, tax payments, expenses
Analyses for Today's Complex Transactions:
■ Picks up where our Real Estate Anoiyzer left off
• Equivolent compound onnuol interest rate of loon
package
• Yield to maturity for discounted bonds.
• Present volue ot complex annuity schedules
• Value of ownership vs. sole-leosetxick.
■ Profit comparisons for dissimilar investments.
■ Risk evoluotion through "what il" comparisons
Friendly Software for Efficient Operation:
■ Extensive documentation, complete with tutorials ond
sample analyses lor the linancial novice.
• Etrot-toleront ond trouble-lree lor use by the computer
rwvice
• Flexible, prole&sional. paginoted report generotion for
impressive reports en all printers.
• For all Apple Computers with A&K, Applesoft, and one
16-sector disk drive.
7ia
MICRO - The 6502/6809 Journal
No, 40 -September 1981
!
APPLE BONUS
%
Tracemark,
An Apple II Debugging Aid
1
-%
TRACEMARK is a debugging or
study-tool utility, an extension of
the Apple II Monitor TRACE
command. A count of eacti
traced instruction is kept in a
separate memory blocit, and the
trace display rate is controlled
by a game paddle. Certain
complex, highly convoluted
problems can be better
understood using this tool.
Raymond Weisling
Jalan Citropuran No. 23
Surakarta, Jawa Tengah,
Indonesia
During assembly language program
development several debugging tech-
niques are conimonly eniployed, includ-
ing single-step, trace and breakpoint.
The Apple 11 Monitor provides the
facilities for these techniques, although
on a rudimentary level. Use of the
TRACE function causes the program
steps to scroU past at a dizzying speed,
and the only way to stop the function is
to hit the RESET key, which alters the
stack pointer. Single -stepping allows
more careful study of the program under
test, but the manual requirements of
typing the command 'S' for each step
quickly become tedious.
TRACEIVLARK was developed to fill
this spectrum of capability, and it also
introduces an even more powerful tool
for software detective work: 'footprint-
ing' (herein called a 'mark']. How often
have you wanted to know where a faulty
program has gone to reach some (usual-
ly] faulty result? With single-stepping
you can see the program flow, but mak-
ing a record requires tedious hand-
copying of the addresses. TRACEMARK
not only makes a mark of the where-
abouts of the processor for later evalua-
tion, but keeps count of the number of
times each instruction is executed (255
maximimi). The only thing we sacrifice
is knowing the order of instructions and
why a certain branch occurred.
Specifically, TRACEMARK calls the
Monitor single-step routine (not found
in the Auto-start ROM — but if you are
doing assembly language work you prob-
ably have the standard Monitor, or
should]. Each instruction is displayed as
if in the free-running Trace mode, but
the speed is controlled by the game pad-
dle 0, from full speed (almost) to a com-
plete stop. For the address of each in-
struction executed, an offset address is
generated, which points to a free
memory area (mark buffer] where the
count of each instruction resides. This
coimt is incremented up to a maximum
of 255 [$FF]. Multiple byte instructions
have each byte marked identically, so
any wild branches into the operand por-
tion of an instruction will show differing
mark counts.
The mark buffer resides "in
parallel" with the program under test.
That is, the offset of the address is only
done to the high byte, greatly simplify-
ing the mental work required when in-
specting the mark buffer later. The pro-
gram does not check to see if the mark
buffer address is within the bounds of
the actual mark buffer, so care must be
exercised in selecting an offset value
based on the expected range of the pro-
gram tmder test. If extremely wide
ranges are expected, it might be best to
insert some boundary checking into
TRACEMARK,
PTogratn Operation
TRACEMARK, as shown in the
assembly listing, resides at that popular
spot, $300. It may be re-assembled to
any convenient location. Similarly, page
zero use may be adjusted to avoid con-
flicts (TPCL, TPCH, TA, TB, & TC)-
From the Monitor, preset values for the
trace beginning point (TPCL, TPCH),
the mark buffer low boundary (TA, TB)
and the mark buffer high boundary high
byte (TC). Then call $300. First the
mark buffer is filled with zeros by
CLEAR. The Monitor program counter
is then loaded with the trace start ad-
Listing 1
LINE* LDC
CODE
LINE
0007
0000
J TftftCEHfiftK
0003
ODOO
; REU
ei - Z7 DEC 1930
D001
0000
) R WEISLIWGi SURAKARTrt. INDUNESIfl
Q0D5
0000
«=t300
00D6
0300
TPCL
= too
;tracemork pgograh counter —
0007
0300
TPCH
= «01
[— ALSO TRACE START ADDRESS
DOOB
0300
Tft
= »02
JTRACEMARK buffer start (LOl
000?
O30O
T.E
- t03
1 (HI J
onto
0300
TC
^ JO'S
iBUFFER END (HI)
QOll
0300
LEHGTH
= «2F
Doi;
0300
PEL
=^ t3fi
[MONITOR PC
0013
0300
PCH
= tae
0011
030
STEP
= »FA13
;TRfiCE SINGLE STEP ROUTINE
OOIS
0300
PREOD
= tFElE
JHONITOR - READ PODQLE VALUE
0016
030
0017
030
i TRftCEMflRK ftND TRACE
DISPLOr RATE UTILITY
oDie
030
0019
03O0
2D1E03
START
JSR CLEBR
; ENTER HERE FROM MGNITUR
0020
0303
B500
LDA TPCL
lUPDATE MONITOR PROGRAM CUUWTER
021
0305
S53ft
STA PCL
022
0307
0501
LDA TPCH
ffD23
0309
B53E1
STA PCH
003^
0301;
2013FB
AGAIN
JSR STEP
iDO ONE STEP IN MONITOR
025
030E
0501
LDA TPCH
iEET ADDRESS (PCL/H 1 STEP AHEAO>
00Z4
0310
3S
SEC
002?
0311
E9D0
SPC UDO
!<-CHANGE THIS FDR OTHER OFFSETS
ooze
0313
SSOl
STA TPCH
f OFFSET FOR MARKING
0029
0315
A12F
LDY LENGTH
;S1ZE DP INSTRUCTION, 1-3 PYIES (0-2)
0030
0317
BlOO
LOn (TPCDiY
iGET FORMER MORK VALUE
(Continued)
No. 40 - September 1981
MICRO - The 6502/6809 Journal
79
APPLE BONUS
dress, and the single-step display loop
begins. After the call to STEP, the mark
buffer address is calculated from TPCL,
TPCH values (the Monitor PC is already
set for the next instruction).
LENGTH is a value representing the
size of the last instruction disassembled
(less one), and acts as an index to LOOP
for marking each byte of multi-byte in-
structions. The previous mark count is
first read and checked to prevent
overflow, and then the incremented
count is returned to the mark btiffer.
The paddle is read by a call to PREAD in
the Monitor, and the returned value is
used to set the repeat count of two
nested timing loops. In addition, the
value is tested to see if it is in the range
of $FC to $FF, and if so, the paddle is
read again (and again] tmtil the value
drops below $FC, effectively breezing
the display. The paddle read-rate is
slowed down by doing this value
testing, after the inner loop, to
eliminate errors caused from calling the
PREAD routine too rapidly, (This
caveat, mentioned in the Apple litera-
ture, is due to circuit peculiarities of
this crude a/d converter.
Having the speed control is handy to
use: slow down or stop the display for
close inspection or let it run at full speed
for those loops that work well. TRACE-
MARK will continue as long as possible
— the only means of exit are encounter-
ing a BRK or hitting 'RESET,' Before
calling the program again, be sure to
reset the five bytes in page zero to the
correct values for initializing the mark
buffet and starting the trace. If more
page zero space can be spent, these in-
itial values could be made non-
destructive (but the program will be
slightly longer].
Example of Use
Let us see how TRACEMARK oper-
ates by running it to trace the Apple In-
teger BASIC program. This is a good ex-
ample of a program which is highly con-
voluted and which cannot be debugged
by conventional breakpoints, since it
resides in ROM, The listing shows line
27 as bemg SBC #$D0, which is the off-
set for this example. Thus BASIC, mn-
ning from $EO00 to $FFFF (including
display calls to within the Monitor) will
be marked from $1000 to $2FFF (mark
buffer). Now, preset the page zero
registers as follows:
00:00 EO 00 10 30 'return'
This means to stan the trace at $E00O
(cold start], clearing the mark buffer
from $1000 to $2FFP. Next, call
TRACEMARK and watch the trace
Listing
1 (Continued)
9031
0319
Ab
TAX
D032
GSlfl
EB
INK
EUnp BY ONE
0033
031E:
F0 0&
EEQ
DONE
PREVENT rtfiRK OVERFLOW BEYOND tFF
0031
031D
sa
TXA
0035
03ie
9100 LOOP
STA
(TPCLf.Y
JSAUE BUMPED MARK
0!l3i
0320
8S
DEY
037
0321
lOFE
epL
LOOP
REPEAT IF 2-3 BYTE INSTRUCTIOW
9039
0323
AS3A DONE
LDA
PCL
;ready local pc for next step
0037
0325
8500
STA
TPCL
D010
327
fl53E
LDA
F'CH
0011
03J9
€501
STfl
TF'CH :
TRACEMftRi; PHASE DONE
0012
D32E
nZOO FJD
LDX
to
iDTBPLflV RATE PHASE BEGIN
0013
03ZD
201EFe
JSR
PREAD :
READ PADDLE UALUE
0011
0330
8101
STY
TC
SAVE FDR DELAY RESTORE USE
DCrlfi
332
CB
I NY
ADJUST FUR DEC BEFORE TEST
01114
0333
aaoa
STft
Tfi
0D17
0335
eso3
STfi
re
0D1B
0337
[:602 PLOP
OFC
TA
! INNER DELAY LOOP
019
0339
DOFC
EiNE
PLDP
OOSO
033D
0501
LDA
TC
CET PADDLE UALUE AGAIN
0051
OD^D
BS02
STA
TA
RESTORE INNER LDOP
0052
033F
(5903
LDA
403
MAKE LOW 2 BITS HI
C0S3
03<H
0501
ORA
TC
OR WITH PADDLE VALUE (IIIJIIXX)
0D51
0313
(18
TRY
— IF RESULT «FF AND —
cnss
0311
C8
INY
— HERE MADE ZERO THEN --
OJSi
0315
F0E1
PEO
RO
GO BACK TO READ PADDLE (DISPLAY FREEZE!
LINE* LOC
code: line
DII57
D317
C603
OEC
le
OUTER DELAY LDOP
ooss
0319
OOEC
E!NE
PLOP
DELAY TIME = PfiDULC UALUE SQUARED
0059
0316
1C0E03
JKP
ACBIN
DISPLAY RATE PHASE DONE - REPEAT
0060
n31E
00£1
031E
CLE^R HfiRK BUFFER FROM ITETfl TO tTCOO |
0042
031E
ITHE5E
hUST EE PRELDflDED FROM MONITOR
0Ci3
D31C
EACH TIME PROGRAM
IS CALLED - BEHAREl
0061
031E
OOAS
031E
ftlDO CLEAR LDr
•EOD
;CLEAR MARK BUFFER, Tfl/TB = FIRST
eoi/.
0350
90
TYA
ADDRESS DF BUFFER
00i7
03S1
71 DZ CLOP
STA
ITAIiY
fZEfiO MEflORY BYTE
0068
03S3
E£02
INC
TA
EiUMF' ADDRESS LD
CDi9
035S
DOFfl
SNE
CLOP
0070
0357
E&oa
INC
te;
CARRY - BUMP ADDRESS HI
0D71
03S9
flSOl
LDA
TC
GLT LAST ADDRESS LIMIT
007?
033B
C503
i;nr
TE:
CHECK LIMIT AGAINST HI PART
0073
035D
DOEF
BNE
CLEAR
MORE TO CLEAR
0071
035r
60
RTS
DONE
CI17S
0360
.END
display, using the paddle for rate con-
trol. At some point hit 'reset' and then
inspect the mark buffer. It will contain
many zeros of course — those are places
never reached by the program. But look
at $2000-2022 (representing $FO00-
$F022) or around $2C62-2CA7 (the
scroll routines in the Monitor) and you
will see evidence that the program
worked here for some time.
While this program seems pretty
dependent on the Apple D firmware and
hardware, it shows merit for study by
those with other systems, since the con-
cept of making a parallel counter or
mark buffer is process or- independent.
All that is necessary is a processor
simulator trace program which can
singie-step and yield the address of each
step and optionally the size of each in-
struction traced.
Limitations
Performing a TRACEMARK on a
program with even a small amoimt of
printing, via the Monitor display and
scroll routines, will consume some con-
siderable time while scrolling the text
buffer. Worse still is the problem of a
program which alters the two-byte out-
put vector at $36-37 (CSWL), since one
byte will be changed while the other re-
mains unchanged, and everything will
come to a grinding halt (when the trace
program tries to output something to a
half-baked jump vector). Additionally,
some other Monitor routines may not be
traceable, due to ambiguities relating to
display status. The other limit is that of
space, with no room for both the pro-
gram under test and the mark buffer.
Here some segmentation of the area to
be marked, with mark buffer boundary
checking, is called for,
TRACEMARK should enhance the
set of debugging tools commonly
employed for development of programs
at the assembler level, and is also useful
where coupled with a disassembler, for
study of undocumented programs in
native machine code, I hope that use of
TRACEMARK will cut time from an oft-
times painful and tedious chore as it has
done for me.
Rajrmond Weisling has two degrees in
music composition from California
Institute of the Arts, where he also worked
on software developmeni in the Hybrid
Computer Music Studio. He was a
software and hardware designer for an
Indus I rial electronics manufacturer before
resuming his artistic career. He uses the
Apple II for design support in making
acoustic and kinetic sculptures,
JUCftO
I
so
MICRO - The 6502^809 Journal
No,40-Septemberl981
*
1
PRICE BREAKTHI^OUGH
r6K RAM BOARDS FOR
APPLE JUST ^129.95
HWE NOU BEEN WAITING f=OC THE C05I
OF EXPWJSION BOACOS TO COME OOWi^
VOUS WAIT IS OVER. 'JP UNTIL NOW BAM
EXPANSION HftS COST AS MUCH AS
SI'JS.OO. ^B^V OMEG* MICBOWAfie IS
PROJO TO AN.'JOUNCE THE ARRIVAL OF A
TGllN AFFORDABLE EXPWiSION CARD.
NOW vOJ CAN RUN PASCAL, FORTRAN.
56K CPM WITH A ZSO SOFTCARD,
INTEGER BASIC, APPLESOFT AND OTHER
LANGUAGES ON \OLR APPLE, mw \0U
CAN ISiOJEASE USUABLE MEMOGV FOR
VISICALC. NOWNOUDONThAVETOPASA
FORTUNE TO HAVE ALL THIS.
AT Sf29.95, OMEGAS HAMEX li IS THE
LOWEST PRICED CARD AVAILAR.E
TODAS.
WHAT CO SOU GIVE UP WHEN 'iDO
PURCHASE THIS FIRST REALl'*
appocpable bam expansion card?
well, vou give up having to cemove
ONE RAM Chip FROM The MOTHER BOARD
OP VOUR APPLE. SCO GIVE UP HAVING TO
STRAP A CABLE PCOM ThE CARD TO ■<OLIR
MOTHER BOARD. THAT'S IT. WHAT SCU
GET IS A SIMPLE. RELIABLE, BOARD
THAT JUST Plugs in. MEMORy refresh
IS aCcompliSheo on The BOAi^p
ITSELF.
The HAMExffe IS Guaranteed NOT JUST
FOR 90 DASS. NOT EVEN b MONTHS. OUR
WAPGENTV IS FOR ONE FULL NEAR FROM
DATE OP PlM:hASE. WE WILL REPAIR OR
REPLACE AN'J GOACPThAT IS DEFECTIVE
through manufaaure for a period
opcnevearafterpurchaseprovided
This damage is not user inflicted,
CCDER VOUR BAMEXtfi NOW BY CALLING
TOLL FBEE i-800 835 2246. («NSAS
BESIOENTS CALL l-SOO-362 2421.
MASTERCARD OR VISA ACCEPTED OR
SEM)SI29.9S. ILLINOIS RESIDENTS ADD
S7.30 SALES TAX.
ANOTHER OUALITS PRODUCT FKJM
OMEGA MICROWAEE, INC.
FORMERLY OMEGA SOPTWARE
PRODUCTS, INC.
222 SO. RIVERSIDE PlAZA
CHICAGO. IL 60606
PHONE 5I2-6'IS-I944
'"OMEGA MICBOWABE. IMC.
IfriLE 4Na ifPLlSCfr ICE UEtlSrfSEO
rffAptA^iP^S Cf APfLf lXM(TJ''El^. it^Z Pft5CAi_ IS A
KSISIESEH 'GWEHiCt; IF THE iSOenTS OF IH£
lAIV a' C^ S«M3IE60. UlSICfli-C ISilftlilSrECED
'BVeniS^K 0= P£5S»«L ia^TwMS. CPM IS »
;bo is a swsrao! raAwtAB^ of zlcg i^
KJflCUa 15 1 OEGjS'EBEO rjADMABK Of
MiCeOSOFr
HAVE YOU EVER WORKED ON A PROGRAM LATE INTO THE NIGHT?
Now with the Program Line Editor (PLE}. pro-
gram development and modification take only a
fraction of the time previously required. PLE is the
most sophisticated program development tool ever
made for the Apple II' computer, letting you devote
your energies to design, analysis, and testing instead
of the drudgery of repetitive keying of program lines
requiring slight changes.
FEATURES INCLUDE:
SOPHISTICATED PROGRAM EDITING FEATURES- More than eleven ediimg commands, such as INSERT. DELETE.
PACK, and FIND allow vo" to change a program line iniith a minimum of kevsirokes.
VERSATILE ESCAPE FUNCTIOWS — User definable command sequences can be assigned lo any key, then invoked when-
ever desired bv pressing ESC and that key. Twenty -seven otedefined functions come with PLE (ROM version
functions cannot be modified).
LISTING CONTROL — This feature allows you to control program listings, CATALOGS, eic, with the touch of a key —
stopping and starting them at mill, or terminating them entirety.
LOWER CASE — Lower case characters can now be entered directly from the keyboard without any cumbersome softwaie
patcties.
PROGRAMMABLE CURSOR CONTROL - Fancy screen displays are made possible with the Programmable cursor
feature. Four characters control cursor movement in all four directions from within PRINT statements.
INVISIBLE AND INDESTRUCTIBLE - When booted. PLE actuallv makes itself a part of the Disk Operating System,
and thus is unaffected by INT, FP, and MAX FILES commands.
NOW AVAILABLE ON DISK OR ROMI
ROM versjon will operate on IViountain Computer, Inc's
ROMPLUS board or the new Andromeda, Inc. ROM board
Disk & ROM versions can operate on any configuration
Apple II or Apple II PLUS with DOS 3.2 or 005 3.3
Apple II IS a trademark of Apple Computer. Inc.
ORDER YOURS TODAY!
DISK, S40.00 / ROM S60.00
Available at your local dealer or send check or money order
to SYf^ERGlSTIC SOFTWARE, 5321 120th Ave, S.E., Bellevue,
Washington 98006.
or call 206-226-3216, Wash, residents add 5.4% sales tax.
No. 40 - September 1981
MICRO - The 6502/6809 Journal
DOWN-TO-EARTH PRICES OIM
OUT-OF-THIS-WORLD PERSONAL
COMPUTERS AND COMPONENTS,
Look at these easy hardware prices:
kM'
Look at this!
^1 86* . \'nm
Ohio Scientific
Superboard II
• It's the first complete computer
system on a board,
• Superboard II uses the ultra
powerful 8502 Microprocessor
• BK Microsoft BASiC-in-RQIVl
• 4K static RAM on board,
expandable to SK
• Full 53-kev keyboard, with upper
and lower case. Plus user
expandability.
• Video interface and audio
cassette interface.
The Ohio Scientific Superboard il at
S329 — in today's economy — has
got to be the best buy by far. It will
entertain you with spectacular
graphics made possible by its ultra
nigh resolution graphics and super
fast BASIC. It will help you in school
or industry, as an ultra powerful
scientific calculator. Advanced
scientific functions and a built-in
"immediate" mode allow you to
solve complex problems without
programming.
The Superboard II can be
expanded economically, for business
uses, or to remotely control your
home appliances and security. Even
communicate with other computers.
Read what's been written
about Superboard II:
"We heartily recommend Super-
board II for the beginner who wants
to get into microcomputers with a
minimum cost. A real computer
with full expandability."
-POPULAR ELECTRDNICS, MARCH 1 979
"The Superboard II is an excellent
choice for the personal computer
enthusiast on a budget."
-BYTE, MAY 1979
610 Board For use with Superboard II and Challenger 1 P.
8K static RAM. Expandable to 24K or 32K system total.
Accepts up to two mini-floppy disk drives. Requires + 5V
@4.5 amps. 5 B9B
Mini-Floppy Disk Dritfo Includes Ohio Scientiflc's PICO OOS
software and connector cable. Compatible with 610
expander board. Requires + 1 2V @1 .5 amps and -i- 5V @
0.7 amps. [Power supply & cabinet not included.] 299
630 Board Contact us for important details, 229
AC-3P 12" combination black and white TV/video monitor, 159
4KP 4K RAM chip set. 79
P5-005 5V 4.5 amp power supply for Superboard II. 45
PS-003 12V power supply for mini-floppies. 45
BF Modulator Battery powered UHF Unit. 35
AC-12P Wireless remote control system. Includes control
console, two lamp modules and two appliance modules, for
use with 630 board. 175
AC-17P Home security system. Includes console, fire
detector, window protection devices and door unit for use
with 630 board. 249
C1P Sams CI P Service manual 8
C4P Sams C4P Service manual 19
C3 Sams Challenger III manual 40
Ohio Scientific and independent suppliers offer hundreds of programs for the
Superboard II, in cassette and mini-floppy form.
Freight Policies ai orders nf^ioocrmcr? are
srtpped ffeight prepa"). Orders of Iess thar $1 00 please edd
S4,0D tu cover shipping coses Ohio residents add 5,5% Sates Tax
tTV ^^^^B|
Hour^ Call Mfliiday thru Friday.
B 00 AM M b.aO PM E O T
TOLL FREE; 1-800-321-5005
Guaranteed Shipment
Cleuetand Ccrsumer Computers S Curnponenls
guarantees shipiiiEnC, ot computer systems
Viflthin ilB flours ipon receot of your ond^
Our fsilura to ahip within 48 hours
sntle^ you to S35 of BDftnare, FHEE.
I
I
I
I
I
I
I
I
I
1
To Order: Or to get our free catalog CALL 1-800-321-5005 TOLL FREE. Charge your
order to your VISA or MASTEn CHARGE accaunt Ohio residents call: [ST 6] 464-8047.
Dr write, including your check or maney order, to the address listed helouv
CLEVELAND CONSUMER
COMPUTERS & COMPONENTS
P.O. Box 46G27
Cleveland, Ohio 44146
nN#jAn Cnnma CLEVELANO consumer P.O. Box 466E7
wPUCr mPITIa COMPLITERSKCaMPONEniTS Clavstand, Ohia 04146
r Superboard II S329. D RF Modulator S35.
U 610 Board $298, D AC-3P 12" B/W Monitor $1 59,
n Mjnj-Floppv Disk Drive S299. n CI P Sams Manual SB.
[Attach separate sheet for other items,]
NAME ^
ADDRESS: .
CITY:
PHONE:
. STATE:
„ZIP: ,
Payment by: VISA
Credit Card Account #_
Expires
MASTER CHARGE .
MONEY ORDER ,
Interbank #[Master Charge]
TOTAL CHARGED OR ENCLOSED $_
. fOhio Residents add B 5% Sales Tax]
DrderG o' less Uian SI 00, please add S4 00 to cauer shipping qoscs. Orders will be accepted Imm U S, and
Canada only All prices Quoted are LJ S . date of publication, standard UPS shipping FOB the factory.
PRICES SUBJECT ID CHANGE WITHOUT NOTICE
'-
1
MICROCRUNCH:
An Ultra-fast Arithmetic
Computing System
Part 2
This article describes software
support for the fast mathematics
hardware outlined In Part I
(39:07). A detailed discussion of
machine code routines
necessary for communication
between the arithmetic
processing chip and BASIC is
given, along with an overview of
a BASIC home-brew compiler.
John E. Hart
Department of Astrogeophysics
University of Colorado
Boulder, Colorado 80309
Part I described a hardware floating
point board and demonstrated that truly
high speed computing is only possible
with a microcomputer if the floating
point chip is used in conjunction with a
compiler. This is true where the overall
program is written in direct machine
code. In this case, the source code higher
level language statements do not need to
be interpreted or pseudo-interpreted (as
in Pascal I ,
This article describes a compiler that
is useful for fast arithmetic processing,
but does not translate statement types
that are rarely if ever used in
mathematical problems, The fun-
damental idea is to use the norma!
Microsoft BASIC interpreter to do most
of the non-mathematical work and to
form the overall program structure.
When a mathematical loop containing
floating point operations needs to be
done, a jump is made to a machine
language subroutine via USR that ex-
ecutes the equations. It is otdy this
machine language subroutine that is
generated by the compiler.
Our system compiles as machine
code subroutines, all the time consum-
ing mathematical operations. The
source code for these subroutines in-
cludes a limited subset of BASIC
statements. Then the full BASIC
language is used to input variables, set
initial conditions, print results of
calculations, and perform calculations
that, because they are not iterated often,
are not time consuming.
There axe several problems that need
to be discussed.
1. How to communicate between
variables used by the
mathematical subroutines and
variables used in the BASIC main
program. Since the C8231
floating point chip uses a non-
standard floating point format (at
least it is different from that used
by Microsoft] it is necessary for
floating point subroutines to have
their own variable space. The
alternative of converting all
BASIC variables to APU
(arithmetic processmg \mit] for-
mat upon entry to a subroutine,
and then reconverting on exit, is
extremely time consuming and
wasteful since only a few of the
variables used are actually input
or output variables. In addition,
any time a change is made in
BASIC the variable table shifts its
position, and BASIC array storage
is cumbersome and inefficient.
2. How to get in and out of a large
number of compiler-generated
machine code mathematical
subroutines. Clearly you would
like the option of writing several
different subroutines and calling
them from different points in the
main program. Thus some kind
of directory management is
necessary.
3. What BASIC statements and
variable allocations do we allow
in the source code for mathe-
matical subroutines?
The Limited BASIC Source
Statements
Variable allocation:
Somewhat like a Tiny BASIC, all
mathematical subroutine variables are
described by a single alphabetic name
A-Z. Unlike Tiny BASIC, any variable
[except I, J, K, L, M, N that are integer
variables for use in FOR loops and in-
dexing) can be either a single number, a
vector (e.g. A|I] | or a two dimensional
array (e.g. U(I,)| ], The vector dimension
and the second array dimension must be
less than 65 and the first array dimen-
sion can be anything consistent with the
memory map. Thus there are two types
of arithmetic that can be done in a
machine language mathematical sub-
routine: integer and floating point. The
integer arithmetic, used mostly for array
indexing [e.g. U|l-2 + K, I + 31| ] is
done by the 6502 and can only be sub-
traction or addition.
Statement List:
SUB#, where # = 1 to 9 mdicating
one of 9 possible subroutines.
RETURN, return from subroutine,
GOSUB#, where #= I to 9. GO to
SUB# given.
GOTO#, where # = 1 to 9. GO to
LABEL* within current subroutine.
FOR I=lTOJ / NEXn Same as
BASIC except no expressions allowed in
index setting part of statement.
IF A-0THENGOTO# Same as
BASIC, except label referred to 1 to 9,
Variable reference (e.g. A| must be sim-
ple variable, not vector, etc. Also less
than is OK. Only comparisons w.r.t.
zero can be made,
LABEL* where #=1 to 9. Jtunp point
for GOTO and IF. ..THEN.
No. 40 -September 1981
MICRO - The 6502/6809 Journal
83
I = r + K-25, etc. General integer
arithmetic involving only integer
variables and numbers less tban 256.
Only addition and subtraction since
these operations are done with the 6502.
Mostly used in vector and array indices.
END Denotes termination of a
particular subroutine.
In addition to these statements, general
mathematical expressions can be writ-
ten exactly as in BASIC. Example:
X= 1.234*U(I-2,J+ 1) + B{J)
*SIN{3,141592'Y)
This is a marked improvement over
such primitive compilers as FLOPTRAN
IV and BASEX that do not allow chained
calculations or indexing.
it can be seen that this subset of
statements is sufficient to implement
almost any conceivable iterative and/or
conditional calculation. The advantages
of the restricted variable set and limited
statement types are a shorter and faster
compUer. You should note that the
compiler must trap all possible source
code errors during the compilation, or
the machine code subroutines will crash
(or give back garbage) and debugging
will be extremely difficult. This error
trapping is the most difficult part of
language translation, and it is made
easier by using the restricted language
outlined above.
Source statements such as those
required to do a long mathematical
iteration or calculation, are entered into
memory under control of an editor, and
then are translated into machine code
and placed in the upper end of memory.
The compiler and editor are written in
BASIC, but being essentially word pro-
cessors and language translators,
execute rapidly. The memory maps for
the compilation and mn modes are
shown in figure 1. The APU variable
space depends on the precise allocation
of variables, dimensions of arrays, etc.
The object code is tied to an initial ob-
ject starting location OI that is set before
compilation.
Variable Format and Exchange
Both Microsoft BASIC and the
C8231 represent floating point numbers
with four bytes. The first byte contains
the exponent, and the next three contain
the mantissa, with the most significant
bit first. Of course here we are talking
about a binary representation where a
number is written as
2 4
8
1x2^
Figure 1: MEMORY MAP (typical). Addresses are decimal
_0
Compilation
Microsoft Overhead
700
BASIC Compiler
16000
Run
_0
Compiler Variables
Source Code
Object Code
_1S,S()0 ([ypl
_20480 (typi
_.n768
Microsoft Overhead
(loc 0-127 swapped out for math, subroutine]
71)0
BASIC:
line 0-6 Overhead
line 6-700 Main Program
line 730-790 Overhead Routines
_4000 (typI
,6000 |typ,, depends on vari-
able allocation)
_ 19768 (01-2001
BASIC variables
APU Variables
Pixcd Routines
and
Swap Storage
Object Code
.20480 IOI + S12]
_32768
Figure 2: Floating Point Formats
BASIC
Byte 1
7
6
5
4
3
2
1
Exponent Sign
Exponent MSB
Byte 2
7
6
5
4
3
2
1
a
b
c
d
e
Exponent LSB
Mantissa Sign (a= 1
inferred imless 0]
APU
Mantissa Sign
Exponent Sign
Exponent MSB
Exponent LSB
Mantissa a = 1 tmless
MANTISSA (most significant bit = bit 6 byte 2)
Byte 3
5
4
3
2
1
Byte 4
7
6
5
4
3
2
I
u
V
w
Mantissa Least Significant Bit
#<
S4
MICRO - The 6502/6809 Joornal
No. 40 - September1981
f
Here E is typically the exponent and a,
b, c, and so forth, are the successive bits
of the three byte mantissa, and are
either or 1. Figure 2 shows the
representations for the two systems. In
BASIC a 1 in bit 7 of byte 2 indicates a
negative number. For the APU, a
negative number is indicated by a I in
bit 7 of byte I! Also, bit 7 of byte 2 in
APU space is always a 1, except if the
number is identically zero. That is, a = 1
unless the number is zero. Note that
since the mantissa sign occurs in byte 1
for the APU variable, the exponent range
is less by a factor of 2 than for the BASIC
variable. Indeed the BASIC exponent
range is +127 to -128, e.g. the expo-
nent is biased by bit 7, or biased
negative 128. However, the APU expo-
nent is only biased negative 64 since the
mantissa sign bit occupies bit 7. Thus
bit 6 gives the exponent sign.
Machine code routines have been
written to convert back and forth
between these two formats. Whenever
you want to input a variable to APU
space, or print out such a number, one
of these routines is called by USR from a
set of BASIC statements that precede
the overall program as shown in figure
1 . This is discussed in more detail
below. First we list a number of
machine code routines that are useful in
communicating between BASIC and the
APU, and between the compiled code
and the APU. These routines must be
entered along with each object code, but
unlike the object they do not change if
either the BASIC source code or main
program is altered.
Fixed Routines
Listing 1 is a BASIC program that
will load all the fixed routines needed
for execution. This program should be
run after entering the initial object
address OI. OI must be a multiple of
256. In the example discussed below it
is 78 "256. The decimal entry points and
functions of the routines entered by this
program are as follows:
^
^
Listing 1
600 R&I FIXED BOirriNES
601 DftTA 32,166,255,216,181,0,157,128,255,202,16,248,162
602 DftlH 127,189,0,255,149,0,202,16,248,32,56,255,162,127.181,0,157,0
603 EfiTft 255,202,16,248,162,127,189,128,255,149,0,202,16,248
604 DATA 173,6,255,41,30,240,3,76,116,162,96
606 FDR J = 01 TO 01 + 55: READ Z: PCKE J, Z: HEXT J
607 DATA 165,5,240,14,56,233,255,16,9,56,255,48,5,169,30,76,153,255
608 TOR J = OI + 170 TO 01 + 187: READ Z: PCKE J.Z: NEXT J
609 PCKE 01 + 176, WL: PCKE 01 + 180,01 / 256 - 1: PCS^E 01 + 187,01 / 256
610 DATR 173,1,251.173,6,251,145,4,200
612 TOR J = 1 TO) 9: RERD H(J): NEXT J
614 TOR J = 01 -f 188 TO 01 + 218 STEP 9: FX:R N = 1 TO 9: PC«E J + N - 1,H(N): NEXT N: NEXT J
618 POKE 01 -•- 223,96
620 DATA 177,4,141.6,251,136
622 TOR J = 01 + 228 TO 01 + 230: PCKE J, 200: NEXT J
624 TOR J = i TO 6: READ H{J) : NEXT J
626 TOR J = 01 + 231 TO 01 + 249 STEP 6: FOR N = 1 TO 6: PCKE J -I- N - 1,H(n)! NEXT N: NEXT J
627 PCKE 01 + 254,96
630 DftTA 173,0,251,173,6,251,48,248,41,30,208,1,96,133,6
632 DATA 104,133,7,104,133,8.76,25,255
634 FOR J = 01 + 140 TO 01 + 163: READ Z: PCKE J,Z: KEKT J
640 rfiTA 8,16,39,31,47
642 FOR J = 1 TO 5: READ Z: POKE 01 -^ Z,OI / 256 + 1: NEST J
644 DATA 24,163
646 FOR J = 1 TO 2: READ Z: Pa<E OI + Z,OI / 256: NEXT J
650 EfiTA 160, 3, 177, 123, 72, 9, 128, 160, 1,145, 1,200, 177, 123, 56, 233, 128, 41
652 DATA 127.136,136,145,1,104,41,128,17,1,145,1,160,5,177,123,136,136
653 [ftTA 145.1, 200, 177, 123, 136,136, 145,1, 96
654 FOR J = 01 -•■ 56 TO OI + 101; READ Z: PCS!E J.Z: NEXT J
656 EftTA 160,3,169,0,145,1,136,48,251,96
658 FOR J = 01 -t- 102 TO 01 -1- 111: READ Z: POKE J,Z: MEXT J
660 CftTA 160,1,177.1,48,12,200,169,0,145,123,200,152,73,6,208,246,96
661 DATA 76,210,255
662 TOR J = 01 -f 117 TO 01 + 137: READ Z: POKE J,Z: NEXT J
663 PCKE 01 + 137.01 / 256 - 1: Pa<E 01 + 2,01 / 256 - 1
665 EfiTA 160,5,162,6,181,0,153,3,211,232,200,200,224,17,208,244,96
667 TOR J = 01 - 120 TO 01 - 104; BEAD Z: PCKE J,Z: NE3<T J
670 CfiTA 41,127,200,200,145,123,160,0,177,1,72,41,128,160,3.17,123,145
672 DATA 123.104,41,127,24,10,48,2,56,234,106.136,145,123,177,1,200
673 DATA 200,145,123,136,177,1,200,200,145,123,96
674 FDR J = OI - 46 TO OI - 1: READ Z: POKE J,Z: NEXT J
676 DATA 165,1,141,224,255,165,2,141,225,255,173,226,255,133.1,173,227
678 CftTA 255,133,2.32.57,255,173.224,255,133.1,173,225,255.133,2,96
679 GCno 684
684 FDR J = 01 - 256 -I- 176 TO 01 - 256 + 209; READ Z: POKE J.Z: HEXT J
686 DATA 4,9,12,17,22,25,30
688 TOR J = : TO 7; READ Z: POKE 01 - 256 + 176 + Z,0I / 256: NEXT J
690 DATA 162,127,169,0,141,6,255,96
692 FDR J = 01 - 90 TO 01 - 83: READ Z: PCKE J,Z: NEXT J
694 POKE OI - 84,01 / 256 + 1: STOP
fConiiiiuedl
No, 40 - September 1961
MICRO - The 6502/6309 Journal
85
OSI
AARDVARK
NOWMEANS BUSINESS!
OSI
WORD PROCESSI^G THE EASV WAY-
WITHMAXI-PROS
This is a line-oriented vuotd processor de-
signed for the office thai doesn't want to send
every new girl out for training in how to type a
letter.
It has automatic right and left margin justi-
Creation and lets you vary the width and margrns
during printing. It has automatic pagination and
automatic page numbering. It uvill print any text
single, double or triple spaced and has text cen-
tering commands. It i/uill make any number of
mufiiple copies or chain fifes together to print an
entire disk of data at one time.
MA>il'PROS has both global and line edit
capabrliiv and the polled keyboard versions
contain a corrected keyboard routine that make
the OSJ keyboard decode as a standard type-
writer keyboard r
MAXI-PROS also has sophisticated file
capabjbilities. It can access a file for n^mes and
addresses, slop for inputs, and print form letters.
U has fife merging capabilities so that it can store
and combine paragraphs and pages in any order.
Best of alt, it is in BASIC (0S65D 51/4" or
8" disk) so that it can be easily adapted to any
printer or printing job and so that It can be sold
for a measly price.
f^AXl PROS - $39.95
NEWNEW-NEW
TINY COMPTLER
The easy way to speed in your programs. The
tiny compiler lets you uvrite and debug your pro-
gram in Basic and Ihen automaticaHy compiles a
Machine Code version thai runs from 50-150
times faster. The tiny compiler generates relocat-
able, native, transportable machine code that can
be run on any 6502 system,
K doe5 have some Umitatiors. It is memory
hungry — SK is the minimum si^ed system that
can run the Compiler. It also handles only a
limited subset of Basic - about 30 keym/ords in-
cluding FOR, M EXT, IF THEN, G0SU8, GOTO,
RETURN, EMD, STOP, USRiX), PEEK, POKE,
'.=.',/-<*,/ ,<\ Variable names A-Z, and Integer
Numbers from G-64K.
TINY COMPILER is written in Basic. It can
be modified and augmented by the user. It comes
with a 20 page manual,
TINVCOMPfUER -$19.95 on tape or disk
THE AARDVARK JOURNAL
FOR OSI USERS - This is a bi-monthfy
tutorial journal running only articles about OSI
systems. Every issue contains programs custom-
ized for OSI, tutorials on how to use and modify
the system, and reviews of OSI refated products.
In the last two years we have run articles like
these!
II A tutorial on Machine Coda for BASIC
programmers.
2) Complete listings of two word processors
for BASIC IN ROM machines.
31 Moving the Directory off track ^2.
41 Listings for 20 game programs for the OSI.
5) How to write high speed BASIC - and
lots m ore —
Vol.1 (19S0I 6 back issues-$9.00
VoL 2 (19811 2 back issues and subscription for
4 additional issues -S9.00.
ACCOUNTS RECEIVABLE - This program
will handle up to 420 open accounts. It will age
accounts, print invoices {including payment
reminders! and give account totals. It can add
automatic interest charges and warnings on late
accounts, and can automalrcally provide and cal-
culate volume discounts r
24K and 0S65D required, dual disks recom-
mended. Specify system.
Accounts Receivable. $99.95
' ' ■ SPECIAL DEAL - NO LESS! " " '
A complete business package for OSI small
systems - (CI, C2, C4 or CBK Includes MAXI-
PROS, GENERAL LEDGER, INVENTORY,
PAYROLL AND ACCOUNTS RECEIVABLE -
ALL THE PROGRAMS THE SN1ALL BUSI-
NESS fVl AN NEEDS. $299.95
P.S. We're so confident of the quality of these
programs thai the documentation contains the
programmer's home phone numberl
SUPERDISK II
This disk contains a nem/ BEXEC" that boots
up with a numbered directory and which allows
creation, deletion and renaming of fjles without
calling other programs. Ii also contains a slight
modification to BASIC to allow 14 character
file names.
The disk contains a disk manager that con-
tains a disk packer, a he>i/dec calculator and
severaf other utilities.
It also has a full screen editor {in machine
code on C2P/C4H that makes corrections a snap.
We'll also toss in renurrjbering and program
search programs — and sell the whole thing tor -
SUPERDISK II $29,95 1 5 1/4"J $34.95 t8"|.
ANDFUN,
TOO!
BOOKKEEPING THE EASY WAY
-WITH BUSINESS I
Our business package 1 is a set ot programs
designed for tile small businessman who does not
iiBve and does not need a full lime actountant
on tiis payroll.
This package is built ground a GENERAL
LEDGER program ^hich records all transactions
and I'jhich provides montfily. quarterly, annual,
and V ear-to -date PROFIT AND LOSS statements.
GENERAL LEDGER also provides for cash
account balancing, provides a BALANCE SHEET
and has modules ior DEPRECIATION and
LOAN ACCOUNT computation.
GENERAL LEDGER [and MODULES) $129.95.
PAYROLL IS designed lo interface with the
GENERAL LEDGER. It will handle annual
records on 30 employees with as many as G
deductions per employee.
PAYROLL- $49.95.
INVENTORY is also designed to interface with
the general ledger. This one ™ll ofovide instant
inloimation on suppliers, initial cost and current
value of your inventory. It also keeps track of the
order points and date of last shipment.
INVEI^JTORV- $59.95.
GAMES FOR ALL SYSTEMS
GALAXIAM 4K - One of the fastest and finest
arcede games ever written for the OSI, this one
features rovjs ol hard-hitting evasive dogfrghtlng
aliens thirsty for your blood- For those who
loved (and rired of) Allen Invaders. Specify
system — A bargain at $9.95
NEW - NEW - NEW
LABYRINTH - 8K - This has a display back-
ground similar [o MINOS as the action rakes
place In a realistic maiS swn frpm gr^iund level.
This is, however, a real time monster hunt as you
track down and shoot mobile monsters on foot-
Checking out and testing this one was the most
fun I've had in years! - $13.95,
NIGHT RIDER - You've seen similar games in
the arcades- You see a winding twisting road
ahead as you try to make time and stav on the
road. NIGHT RIDER uses machine code to gen-
erate excellent high speed graphics - by the same
author as MINOS.
NIGHT RIDER - $12.95 cassette only
THJEF - Another machine code goody for the
C1P cassette only. You must use mobile cannon
to protect the valuable jewels in Ihe middle of
the screen from increasingly nasty and trigger
happy thiefs. Fast action and fun for one or two
players. THIEF $13.95 on CI cassette only I
SUPPORT ROMS FOR BASIC IN ROM MA-
CHINES - C1S/C2S. This ROM adds line edit
functions, software selectable scroll windows,
bell support, choice ol OSI or standard keyboard
routines, two callable screen clears, and software
support for 32-64 characters per line video.
Has one character command to switch model
2 CIP from 24 to 4S character line. When in-
stalled in C2 or C4 <C2SI requires installation
of additional chip. CIP requires only a jumper
change. - $39.95
C1E/C2E similar to above but with extended
machine code monitor, - $59.95
OSI
Please specify system on all orders
This is onlv a partial lisims of what we have to offer. We now offer over 100 programs, dala sheets, ROMS, and boards
for OSI sysrems. Our $1.00 catalog Nsls il all and contains free program Ibijngs and programming hiitts to hoot.
AARDVARK TECHNICAL SERVICES, LTD.
2352 S. Commerce, Walled Lake, Ml 48088
(313)669-3110
OSI
86
MICRO - The 6502^809 Journal
No. 40 -September 1981
f
0I-8D Protect zero page address 1
and 2 for APU BASIC conver-
sions, and jump to proper
conversion routine.
OI-46 Convert APU variable whose
start address is set in location
1 and 2 and place result in
BASIC variable pointed to by
location 123-124 |the BASIC
variable X since this is the
first variable called by the
rnain program as given in
LIST 2 below).
OI Entry to object code. Swap
lower half of page zero to
upper memory, jump to
routine called from main pro-
gram, swap back page zero,
check for address range error,
and return (warm start if error
set],
OI-I-56 Convert BASIC variable
pointed to by 123-124 to APU
variable and set in four loca-
tions starting with that
pointed to by 1-2.
OI-i-llZ APU to BASIC conversion
entry. Check if APU = 0, if so
set X = 0, otherwise jump to
OI-46.
OI -t- 140 Check APU for error and busy
status. If there has been an
error (see part Ij, pull program
counter off stack and exit.
OI-t-170 Read APU floating point
number on top of APU stack
to memory starting with loca-
tion pointed to by 4-5.
01 + 228 Write memory floating point
number starting at location
pointed to by 4-5 to top of
APU stack.
BASIC Fixed Routines
When a machine code mathematical
subroutine is run a few BASIC
statements must be included in the
main program. These are given in list 2,
The first line makes sure X is at the head
of the variable table by setting it equal to
zero. It also sets OI. Subroutines 730
and 735 set the variable address bases for
the variable A,B,C,D,E,P,G,H,T,X,Y,Z.
That is, MP contains the relative address
on page zero [after swapping] for these
variables. For example, A starts at loca-
tion 20, B at 24, etc., X at 56, Y at 60,
and Z at 64, These subroutines are call-
ed before the main program in lines
8-700.
The main program written out in list
2 is used to mn the mathematical test
loop described below. Line 8 identifies
the APU variable X, sets BASIC X = l,
and calls subroutine 770 which executes
a USR jump to the fixed routine that
converts between these variables.
Similarly, line 9 causes APU variable A
to be set equal to the constant 1.00013.
Line 10 identifies a call to the
subroutine J whose starting address is
set in line 2 (the first subroutine always
starts at location Ol + Sll], then ex-
ecutes this jump. Finally, line 1 1 iden-
tifies a variable X that is converted, and
then printed. In the conversion calls,
first set Z$ equal to the desired variable
name, then CALL 770 to go from BASIC
to APU, or 780 for the inverse.
The fixed routines outlined above,
and these BASIC overhead instmctions,
are sufficient to manage a large number
of mathematical subroutines and APU
variables. If there is a warm start after a
mathematical subroutine call, a
GOSUB750 will print out the error code
and an object address of a place near
where the error occurred.
An Example
Consider the multiplication test pro-
gram discussed in part I. This called for
consecutive mnltiplication of X by a
specified constant A for 40,000 times.
One program to do this would set A and
X, and call the following mathematical
subroutine.
SUB1
FORI = 1T0200
FOR J^1TO200
X^X-A
NEXTJ
NEXTI
RETURN
END
Note that two nested FOR loops are
needed to get 40,000 because integer
variables are limited to a range of to
255 each.
List 3 gives detailed description of
the object code generated by the com-
piler when the above statements were
entered as a source code. Note
OI- 19968 for this example.
By inspecting this program you can
see that the 6502 is used for loop con-
trol. The variable table is the same as
was set in statement 733-734 of list 2. A
is at loc 20, X at 56. Note that some
6502 statements are executed concur-
rently while the C8231 is multiplying
(20541-20549). Writing short
mathematical expressions like X = X*A
does not allow much co-processing
because you are primarily reading and
Listing 2
1 X = 0: DIM S(20}:01 = 78 ' ?56
2 S(l) = 30480
5 GOSUB 730: GOSUB 735
6 REM HJD HEADER. MAIH PECGRAM, LINES 9-700.
8 Z$ = "X"lX = 1: GOSUB 770: REW BEGIN MAIN PEfCGRflM. SET EUBR. VARIABLE X=l.
9 ZS = "ft":X = 1.00013: GCSUB 770; REM SET MATH SUBECtTTIKE CCNSTANT A=l .00013
10 J = 1: PRXNT "START": GOSUB 760: REM ENTER MATO SUBROUIINE
11 Z¥ = "X": GOSUB 7B0: PRIWT X: REM PRINT PltM. VSLUE OF X APTER 40,000 MLLTS
20 STOP
730 KSM V7!RIABI£ ADERESS BAEES~SING1£ VARIABLES Ctfl-Y
731 DIM NF(2ei
733 FOR J - I TO 8:NF{J] - 16 + 4 * J: NEXT j!NF{20 = 52:NF[24) = 56:NF(25) - 60
734 NF(26) = 64: REJTURN
735 REM SET CC*JSTAMTS FOR OVERHEAD ROUTINES
738 S(]0) - 01 + 226:S(1I) - 01 + 227:S(15) = 256
739 S{14) - OI / 256 - 1:S116) - 01 + 23:5(171 = OI -F 24:5(181 = 01 - 59; BEIVRN
750 RH^ EPROR CHECK
pRiwr "EaawR code="; peek (oi + 2621 and 30
PRIWr "ADDRESS="; PEH; (OI + 263) + PEEK (01 + 264) ' 256: PROn' : SETVPS
REM 760 IS SUB CALL EKn« J=SUBtt
IF J > 9 OR J < 1 OR S(J) = THHJ PRINT "!U- SUE CALL ID #"rJ: STOP
761 X = S(J):XS = INT (X / 256): POKE S(17).XS: PCKE E(16),X - 256 * XS
763 PCKE 11,0: PCKE 12,01 / 256:X - USR 10): RETURN
770 RBM BASIC TO ARl CCMU, Z5=CHAR, J=INDEX, I=PftGE INDEX
771 XS = ASC (2S) - 64: IF XS < > 10 THEM IF NF(XS) < > THEM I = 1:J = 1
772 POKE 11,176: POKE 12.S(14): POKE S(10).KF{XS)
773 E<KE S(lll,79: IF X = THQJ POKF S(18),103
774 IF X < > THEN PCCT: S(18),56
775 XS = USR (0): RBIURN
7S0 REM APU TO BASIC
781 XS = ASC (ES) - 64: IF XS < > 10 THEM IF NF(XS) < > IHEM I = lij = 1
782 FCKE 11,176: POKE 12,S114): PCKE S(10),NF(XS)
783 FCKE S[n).79: POKl: S11B).117
784 XS - USR (0): RETURN
751
752
759
760
No. 40 -September 1981
MICRO - The 6502/6809 Journal
87
List 3: A sample obfect code {all addresses decimal).
20480
162,1
LDX-IMM
1
20482
202
DEX
20483
134,10
STX-Z
10
initialize integer I [I at loc 10
page zero]
20485
166,10
LDX-Z
10
loadl
20487
224,200
CPX-IM
200
I equal to 200?
20489
208,3
BNE
3
20491
76,81,80
IMP
20561
If true jump out of For loop.
20494
232
INX
If I less than 200 increment.
20495
134,10
STX-Z
10
restore I
20497
162,1
LDX-IMM
1
20499
202
DEX
20500
134,11
STX-Z
11
initialize integer J [J at loc 11
page zero)
20502
166,11
LDX-Z
11
load J
20504
224,200
CPX-IM
200
J equal to 200?
20506
208,3
BNE
3
20508
76,78,80
IMP
20558
If true jump out to next I
20511
232
INX
If ] less than 200 increment f
20512
134,11
STX-Z
11
restore I
20514
169,56
LDA-IM
56
load address base for variable X
(io)
20516
133,4
STA-Z
4
put into zero page loc 4 [variable
pointer)
20518
160,0
LDY-IM
20520
132,5
STY-Z
5
put address base (hi) into loc 5
20522
32,228,78
)SR
20196
goto fixed routine to write X to
top of APU stack
20525
169,20
LDA-IMM
20
load address base for variable A
(loc 20, pageO)
20527
133,4
STY-Z
4
set address pointer
20529
160,0
LDY-IM
20531
132,5
STY-Z
5
20533
32,228,78
rsR
20196
v/rite variable A to APU stack (to
20536 169,18 LDA-IM
20538 141,7,251 STA-AB
20541 169,56
20543
20545
20547
20549
133,4
160,0
132,5
32,140,78
LDA-IM
STA-Z
LDA-IM
STY-Z
|SR
20552 32,170,78 fSR
20555 76,22,80 JMP
20558 76,5,80 [MP
20561 96 RTS
18
64263
56
4
5
20108
20138
20502
20485
Ol + 228)
load op code for multiply
command APU to multiply top of
stack by next on stack, restilt to
top of stack
set address base for variable X
|loc 56 page 0)
APU busy-error check |to
01+140)
Read APU to memory (to
OI-I-170)
J loop retimi
I loop return
return from subroutine 1.
writing from the APU. However, in
longer calculations involving arrays and
complicated indexing, time saved by co-
processing can amount to a factor of 2 or
more.
The above listings, along with this
example, should give the reader enough
information to write machine code
subroutines by hand. The 6502 just im-
plements, writes, and reads to and from
the APU, sends it commands and checks
its status. Standard 6502 operations can
be used for loop control, j um p'; between
subroutines, etc. It should be possible,
without undo effort, to write out such
object codes for fairly straightforward
calculations. If you want to try this par-
ticular program the DATA list in listing
4 should be helpful.
OftTR 162, 1 , 202, 134, 10. 166, 10,224.200. 208
nftTO 3,76,81,80.232,134,10,162,1,202
UftTft 134,11,166,11,224.200,208,3,76,78
DftTA 80,232,134,11,169,56,133.4,160.0
EATA 132,5,32,228.78,169.30,133,4,160
DfilR 0. 132, 5, 32, 228, 78, 169, 18, 141, 7
DfiTA 251,169.56,133.4,160.0,132,5,32
EftlR 140,78,32,170,78,76,22,80,76,5
ram so, 96
Of course, the ultimate situation is
to have the compiler write out the object
code as illustrated above. Clearly it
takes each BASIC source statement and
branches out to routines that parse
through the line according to the fun-
damental Operation [e.g. FOR, NEXT, a
mathematical expression, etc.). The
most complicated aspects of a compiler
involve rewriting general mathematical
expressions into a stack-processing type
form suitable for the C8231, and in the
process trapping any errors in the source
code. The compiler is much too long to
list here [16K of BASIC statements), or
to describe in detail. However, I hope
these two articles have illustrated how
fast mathematical processing can be car-
ried out on a simple micro at minima!
cost. Enough material has been
presented to write and execute simple
mathematical subroutines. For further
information (a complete manual and
cassette tape] on the compiler please
write the author.
Two years ago John Hart became interested
in using a microcomputer to control
laboratory experiments, and to do
theoretical calculations involved with his
research in naeteorology and physical
oceanography. The system described above
has been used to solve a variety of problems
concerned with flow over or around
mountains and simple climate models.
iUCAO
86
MICRO - The 6502/6809 Journal
No.40-Seplember1981
Here's the KEY
to your Apple®!
Hondbooh
Computer
Station's
Programmers
^ Handbook
for the
Apple®
Retail Price
29.95
IndeNed Looseleaf noiebook {7''2" x9"]
conlainiiig all ihc reference marerial lound in our
popular Programmers Guide to Ihe Apple II '
• Applesoft Si Inlegei
• CP.M DigllaL
Reseaich, Inc
• BaBic-80 Microsoft
• Pascal
• 6502 Assembly Language
• DOS 3 3
• DOS Tool Kit
• Moniloi
Including Command References foi
Applewillpr' ■ Macro-Seed
Visicak ' Personal Solturaie
Hardware Configurations &
Software Commands for
Spinu/ri1«r
PapeiTlgei
• Silpnt^pe
• Spi^cialROMs
Two dislselte pockets in front & back. Noiebook
formal allows user lo add persona! commenls. A
must for every Apple' owner Available from your
local Apple' Dealer or from:
Computer Station
11610 Pase Service Dr.
St. Louis. MO. 63141
(314)432-7019
Direct order will incur a E2 00 shipping/handling
charge plus sales lax where applicable
Appte, Applpll And ^pplttntt Ar'EhpTp^lilpred Irndpiiiarli s al
Apple CompulFr. Inc
NEW!
CHECKBOaK . CHCCKV WRITER
PROGRAM FOP.
TRS 80CC"- APPLE 11'"
TRS 80 MODI/ LEVEL II'"
JP5 BO MODEL III
CASSETTE TAPE S9.95
(. or Lt$T|NG
NOW. . -Continuous Checks
That Can be Used With or Without Your Computer!!
The Best in A Home Checking System
Thai's rigtit Coiiiiniious Chec^s fan folded m
it3-iD-a-p^yL-diiak £€i[dei&itin Andihuyi^anbu
pampuEer prrnrecT^ hErndwrillen or lypQivrilEen
— nrhichevpr siiil!i Ihe qujiitltly or ^JluAliOn
SPECIAL DESIGN
Our Cltech^ B'p. not a higit- volume bu&incss
luim adBplel'Oit Thpv'''^ speciEiily dd^igitird
CompulCr/ Manual Chech^ lor Ihe horrm
iisEir And they're tasv lov^^- <*>'' Nnrieedia
fliange prirllLT form w<dlh when load'nc] Our
chechE are Ihe umti 9Vi" wkllh as standard
Iraclor feed pnnler pUpur CMuek rear njo^n
5I7S 1^ Ihe ^aire as The cla^^ic pBr«]Tlal-Eifed
ehecli issued hv ilJ banks
COMPLETE HOME SYSTEM
Witri iJiPSSysir^nkyuu Cijn prinilhc:Liilt:olyuiii
manlhly cltdck^ uO youl Lompul^r u^ing aiir
prngram. Your chech^and BltibE can Ihen bp
bicied in out allraclive Daid Rin^j Binder
ChechbDDk- Uner, iP you h^ve a lev; checks lo
wriie. there's no need (e load Ihem mlo a
printer - ludl wrtie a cbeck al your desk as
^hown above And veu can mai< your checks m
our dual windowed envelapcs le clirriinale
a<ldressmg chores
UNIQUE
Vue VhT>n'l fiPid Ennlinuous checks liko IhirSQ
unywIierE And, ojr special sniilK qu^nlily
prmling process Will giUE: yDii HAcellenl qualilv
and appearance Standard color- cnnrdmated
irriprmlmg And encoding ie as ?bfivjn abnvp
(loga can he omnieflfon blue, grey, green, or
bulf checks
PRICED RIGHT
Two Hundred chei:k^ are |ijs1 ^29.35 fenvO'
lopes 314 951 ^ivp Hundred checks are
549.95 (envelope's 27 .9 5) Data Ring Check-
hooka ^rv only &4.9S.
SpoclBl "OflPER NOW" Oter
So thai V*)!! ^^1^ STDH u^ing your compuler
iiTiinedi^ielv <□ p^y your manihly bills, i^e'li
make you a tpsKiidl package olfer IF you order
dirr^Llly fiom thiE ad^ we c^f send you
200 ChHchs, 101^ EnverapBfi, A Bmde;^.
and Program tor $49.95
OR
500 Checks, 300 Envelopes, A Binder.
and Program for €74 96
You'll save as much ^s S9,e& over Ihe
^iQparale purchase prii^e. And wUh Ihe special
package yau can hegm your monlhly check'
book balancing arid bill paying as soon as you
receive your checks, Jusl enclose a vojded
check jfor encoding inlormaliorf wiih ^ur
PBVmeni (VI 5 A - MaslcrCard orders musi
show sicrnaure, expire non dai?, and accouni
nuJlkbe') Oi Send inday ror samples
SYNERGETJC '^"''^ Shepherd hd
SOLUTIONS DEPARTMENT M91
PHOr^E 13I3I646-6BB7 MULBERRY, FL 33860
No. 40 - September 1981
lililililiiililllllllilililllllilllilillliliilliiililililllJIIIIirillllllllillliiilJIIII
ATTENTION: SOFTWARE AUTHORS
OHIO SCIENTIFIC
(A m/a— COM COMPANY)
IS SEEKING A
6502 based, full screen edit, cursor orientated wore
processor to run on Its Challenger series microcomputers
Programs submitted should either currently run on O.S.I.
products or should include parameters on adaptability.
Ability to operate on both memory mapped video and serial
CRT, as well as data file linkage, preferred.
Legal Authors should contact the official agents:
—Department W.P., Anaheim Computer Distributing, 1150
Knollwood Circle, Anaheim, California 92801, U.S.A.
Any copyright information or preconditions should be
stated at the time of submission of program. Both Ohio
Scientific and Anaheim Computer Distributing will treat all
communications in the strictest confidence.
For any discussion call Keith Beverton at 1-714/995-3041
between 11:30 a.m. and 12:30 p.m. (19.30 and 20.30 GMT)
-Monday to Friday.
llllllllllllllllllllllllllllllllllllll|l|l|||||II||]|||j||||||l||||||||||l|l|l|||{|;il|||ll
MICRO - The 6502/6809 Journal 89
OSI COMPATIBLE HARDWARE
lO-CAlOXSEff I ALPORT S125
ACIA cased flS 232 serial punier pan. DIP SWITCH seleclable baud rarea ol 300 9600.
Handshaking (CTS)inpul line is provided lo signal Ihe compuler when The prinlerbuHer
Is lull CornDaliblewUhOS-65LI V1.2 andOS-65D-
I0-CA9 PARALLEL PORT Sl7fi
Cenironics Standard Parallel prin(ennLerrace lor OSI compurers. The card comes com-
plele L^ilh 10 ri. of Mat ribbon cable. Compglible ^iih OS^^D and OS-65U software
IO-CA9D DIABLO PAR ALL EL PORT 117S
DIABLO r2BlT WORD Parallel port for use wilfi word processor type printers. Complele
wrlb 10 II. cahle. Compaiible wilh OS-65U software.
IO-LEVEL3MULTI.tlSEfl EXPANSION £45D
Provides 3 prmter interfaces currenlly supported by OSl-Serial, Centronics Parallel,
Diabro Parallel 4Ko( memory al DCXXJfor MuUi-userexeculive 4 Porr serial cluster The
LEV EL 3 card allows ex pansion of an OSI C3 machine up !o 4 users Willi appropriale ad'
dlElonal rnemory pa rji lions
2JMEM'CM9...I3B0 16MEMCM9.-S3D0 BMEW CM9.,,S210
24Kmemory card 15 available at 3 different populated levels. All cards are fully socl* el ed
!or24KDlmeinory The card uses 21 l4-30Dn5 chips. DIP SWtTCHadd/essinp is provided
jn Hielormol one l6Kbfock and one 3K block. Al50 supports DIPSWITCH memory parti-
tion addressing lor use in muKi-user systems
FL47DFLOPPYDISK CONTROLLER SIM
OSI -Type lloppy disk conUoller and real Ume clock Will Support 5V. "or 3", Single or
double-Sided drives Requires dnves witti separated data and clock oulpuls.
BJO- TaOO BAR E 1 CAR D $5Q
Su per 1/0 Card. Su pporlsSKol 21 14 memory in IwD DIP SWITCH add res sable 4K blocks,
3l6Bil Parallel Porfs may be used as pnniennle'laces, 5 PlSa32 Serial Porls Willi GTS S
RiS handshaking WilJi manual and Mole:^ connectors.
BEMEMCM9BAREMEMORYCAH0 £50
Bare24K memory card, also supports OSI-lype real lime clock and floppy disk conlroller.
Wrlh manual and MoIeK connectors,
IfM PROTOTYPE CARD $35
Prototype board holds 9S 14 or 16 pin IC's, Will also accommodate 18, 24. or 40 pin IC's,
Row and column zone markings, easy layout V^" epo*iy glass P C. board.
C 1 PEXP EX P A N SI O N 1 NTE RF ACE S65
Expansion lor Cl P60tJ or Gl boards to the OSI 46 Pin Buss. Uses enpansion socket and
inteiface crreuitry lo expand to 49 Pjn Backplane. Requires one slot in backplane
a P-5fiO BACK PLANE *47
Assembled Sslot backplane with mate Molex connectors and terminal ion resislois
OSKSWDISKSWITCH 529
A circuil when gddcdio OSI Mmi floppy systems ex lends the llleol drives and media. Ac-
complish this by shulling oil f^inilloppy Spindle motor when system is not accessing
the drive Complete KIT and nianuak
P W 5-6 PO W ER SU PP L Y S29
Power One brand supply 5V - 6 amps wiihovervoltage proieclion Reg $49 9^
D&N MICRO
INC.
3684 N. Wells Street Ft. Wayne, Indiana 46808
219/485-6414
TERMS: Check or money order Add S2 Shipping^ Outside U.S. add 10%.
Engineering
PROJECT ENGINEER
ELECTRONICS
DEVELOPMENT
If voy appreciate the challenge of a fast-paced, professional
environment, this opportunity within our Hyland Diagnostics
Division may be of inleresl. As a leading international
medical products manufacturer with facilities in operation
throughout ihe world, we seek degreed, "hands-on" electronic
technologists or engineers to modify and develop micro-
processor controlled manufacturing equipment.
Qualified candidates will have shown ability to:
• Successfully meet project objectives
• Design and prototype microprocessor conlrolled
mechanisms
• Effectively interface vuith corporate support and
manufacturingpersonnel
• Program 6502 Synertek Microchips
Strong comniunications and interpersonal skills enabling you
to work closely with all levels of our staff are essential.
This position is located at Travanol's Round Lake facility,
offering ready access to Chicago, Milwaukee, and Wisconsin
resort areas. We provide a competitive salary commensurate
with experience. A generous benefits pacioge includes profit
sharing and employee stock purchase plan. If you seek a
professional environment, send your resume with salary
history and requirements in confidence to: Vincent T. Luber.
Travenol Laboratories, Inc.
Administration BIdg.
P.O. Box 490
TRAVENOL Round Lake, 111. 60073
Equal Opportunity Employer (312) 546-6311
DYNAMIC DUO
Designed and Engineered
Specifically for the
SYNERTEK SYM-1 and KTM-2
• VITAL COMPONENTS PROTECTED
• ALL FASTENERS PROVIDED
• NO ALTERATION REQUIRED
• EASILY ASSEMBLED
ATTRACTIVE FUNCTIONAL PACKAGING
■ High Qualily Theimolormed Plastic*
• Molded In Data Blue Color
• Available From Stock 'aanm s Has5 - rvdei ioo
enclosures
group
7B6 hush street
san Irancisco. California 9']I0S
TO ORDER: 1 FiII m idis coupon (Pmi ur type. Plaast)
2. AKacli Check oj Money Order.
NAME _
STREET
CUV
_ STATE.
_Z1P_
FOR SYM-1: Please Ship Prepaid .
. SSE 1-1(s) @ S39.50 each
TOTAL
ENCLOSED: S_
Peeler inqjirea InvlleH.
California Residents Please Pay 142 07 (Includes Sales Tax)
FOR KTM-2: Please Ship Prepaid SKB 1-3(s) @ $69,50 each
California Residents Please Pay 174.02 (IncluOes Sales Tax)
. No C.O.O;^ Pled3e. -- AltoHi 2.3 Weeks lor Procassing and Delivery.
«
90
MICRO - The 6502/6809 Journal
No. 40 - September 1981
1
I
/MCftO
Classified
SYM-1 Expansionfl
Bare W7AAY 4K RAM boaid: $8.00 plus
SASE. Assembled W7AAY ROM board:
$16.00. RAE symbolic disassembler source
on cassette: $15.00. Instruction packer to
add floppy disks to SYM $15.00. RAE/
KMMM software interface on 5W" disk-
ette: $15.00. SASE for mote information.
John M. Blalock
Blaiock & Associates
P.O. Box 39356
Phoenix, AZ 85069
Extflnded SYM-BASIC
Adds 30 commands, requires I6K, $85
US/$95 Can., object on cassette, manual,
and source listing. SYM-FORTH 1.0: fig-
FORTH for 16K SYM-1 . Editor, assembler,
cassette interface $]3a US/$155 Can.,
object on cassette, manual and souice
listing.
Saturn Software Limited
8246 116A St.
Delta, B.C., V4C 5Y9
Canada
C1 P Extended Monitor
2K EPROM has 14 cursor control /editing
functions, improved keyboard decoding.
Machine language save, load, display,
modify, move, breakpoint processing and
much mote. For 24, 32, 64 char/hne.
$39.95 plus $1.00 shipping. $1.00 for
complete information.
Bustek
P.O. Box A
St. Charles, MO 63301
PETfCBMOwnsrs
Real world software at low cost. 21!4
RAM adapter and 4K Memory Expansion
for "old" 8K PETs. Write for free catalog!
Optimized Data Systems
Dept. M, Box 595
Placentia, CA 92670
PET Arcade SoHware
Astroidz and Munchman games foi your
8K old-new ROMS. Astroidz are invading
the galaxy. Four levels of play. Munchman
is based on arcade game Pac-Man. ZIP and
ZAP are out to get you. Fantastic graphics.
$9.95 each cassette.
ComputerMat
Box 1664M
Lake Havasu, AZ 86403
Spanish Hangman
2,000 SPANISH words and sentences
taught in a fun way on ihe Apple. Send for
your school's free 30-day evaluation
diskette, from:
George Earl
1302 South General McMullen
San Antonio, TX 78237
Ohio Scientific Tea-Shirts
Men's S, M, L in black with blue to white
Logo, $7.50. We also have an XREF pro-
gram [list variables and line *'s|, disk
$24/tape $6.98, and a true backspace,
screen stall and clear for CIP at $6.98.
Please add $.75 postage/ handling on all
orders.
Computet Business Service
P.O. Box 203S4
San Jose, CA 95160
Business Software by ADS
For the Apple D and Atari/800. Why pay
mote for a bunch of unrelated programs?
Business Plus will handle invoices,
statements, credit memos and more,
much more! fust $299 complete or $25 for
demo disk {credited towards purchase).
VISA, Mastercharge accepted.
Advanced Data Systems
7468 Maple Avenue
St. Louis, MO 63143
314/781-9388
Supar-Maze
Attention OSI owners: Get Super-Maze,
similar to the arcade game. Runs on
32 X 64 cassette systems; or 5uper-Maze II
— a faster and more aggressive version.
Send $1.50 for more information, or
$14.95 for Super-Maze, $17.95 for Super-
Maze U. S21.95 for both, $2.00 for hard
copy only,
Vega Enterprises
1564 Locust Ave., Suite lOlA
Long Beach, CA 90813
Free PETfCBM COMAL Interpreter
The battle between BASIC and Pascal may
soon be over. COMAL is winning. COMAL
is powerful and structured like Pascal,
easy to leam and use like BASIC. COMAL
interpreter is FREE with each User's
Croup diskelte. Write iot details.
COMAL User's Group
5501 Groveland Ter.
Madison, WI 53716
SeaFORTH tor KIMfSYMfAIMfSEA
Systems
Threaded subroutine, compiled (not inter-
preted] FORTH is much faster than iig-
FORTH. Editor, assembler, compiler is
8K, ROMable. Floating point, disk exten-
sions. OEM Target Compiler available.
For the advanced FORTH programmer.
Single-user license — $100 (cassette) or
$100 plus ROMs.
Seawell Microsystems
P.O. Box 20367
Seattle, WA 96102
1206) 322-3123
OSI Supert>oard —
Cabinet and Accessories
Pre-cut kit with hardware to build a hand-
some pine cabinet to house your super-
board. Room inside for the power supply
and all your extras, $20. RS-232 interface
kit, $10. Send foi our catalog of software,
hardware, kits and accessories.
Dee Products
150 Birch wood Road
Carpentersville, IL 60110
MCRO
CBM/PET? SEE SKYLES ... CBWI/PET?
''You mean this one little
Disk-O-Pro ROM will give my
PET twenty-five new commands?
And for jusi $75.00? Why, IhaCs onlj S3.00 a command!"
The Disk-O-Pco in any PET with Version ll[ (BASIC 2.0} ROMs I^HII COMMODORE
BASIC imit) will give 19 software compaiibk disk inn ruci ions*; 15 idemical with ihe new
BASIC 4.0 lor wiih 8032 ROMs) compalible with boLh old and new IX)S. Plus 4 addi-
tional disk commands. . .including appending (MtRCtl. overlaying (MERGE * )
and PRINT USIINC. allowing Formatting ouipui of sitings and numbers on the PET
screen or on any printcr.
^NOTE: Old DOS doesr 't recognize three of the commands.
Those are jusi 3 of Ihe imporiani commands — and ihere are 7 more beaurics — on
your Disfc-O-Pro lliai have never been available previously lo PET/CBM users. (Sfcyies
does El again !)...Beauiies like the softiouch key (SET) which allows you to define a key
to equal a sequence of up lo 80 kcyslrokes; like SCROLL whereby all keys repeat as well
as stow scrolling and extra ediiing feaiures; like BEEP which allows you to play music on
your PET.
The DisV-0-Pro iscomplelely compatible with the BASIC programmer's Toolkit- The
chip resides in Ihe socket al hesadecimal address $9000, the righlmosl empty socket in
mo^l PETS- And for the owners of "classic" (or old) PETS, we do have interface
boards.
(For Chose owning a BASIC 4.0 or 8032. even though ihe Disfc-O-Pro may nol be suit-
able, the Command-O is. JusI wrile lo Skyles for additional informalion. Remember, we
have never abandoned a PET owner.)
Complete with B4-page manual wrillen by Greg Yob., .who was having so much fun
thai he got carried away. We had expected 32 pages.
Skyles guaraniecs >our salisCiclioni if you are not absolutely happy with your new
Disk-0-Pro ROM chip, reiurn ii to us within ten days for an immediate full refund.
Disk-O-Profrnm Skyles Kleclric Works.- STS.OO
Complete with interface board (for "classic" PETS) 95.00
Shippins and Handling (USA/Canada) S2.S0 /Europe/Asia) JIO.OO
/^ California residenls musi add 6%'6'/i% so/es lax. as required.
\A/ Skyles Electric Works Visa/Mssleteard order*: call tollfree
H iJIESouih Whiiman Road (800) 227-W98 (escept California).
J^^ Mountain View. California WWI CaUfornia orders: please call (415)
^V (4151 96S-I735 96S-I735.
/lAiaO ■■ S31A>1S 33S 6l3d/IAiaO" w
No. 40 -SepIemt)eFl981
MICRO - The 6502/6809 Journal
91
PANORAMAS!
I! i: a S
BTF.
with
s ...
ff«~.
K .«S
W i \ fii s
H/-fl£S GRAPHICS DUMP ROUTINES
Easy to Use! Multiple Scate Factors!
Precise Reproduction! Normal/Inverse Inking!
Dump either page one or page two, horizontally or
vertically on the paper; or, dump both as a two page
panorama with both pages butted in perfect registra-
tion. Compatible with I/O cards from Apple, Epson, SSM,
Tymac, California Computer and Mountain Computer.
SCALE FACTORS PROVIDED
PRINIEBS
PANORAMIC or VERT
HOPIZ
POST-PAID
SUPPORTED
1X
2X
3>; iX 5X
IX 2X 3X
PRICE
OPSOTO
29 95
DP90DI
•
• •
39 95
DP9B00
• «
t ■
44.95
DP9501
4 * *
* • ■
49 95
MX70
29.96
Mxeo
29 95
UXIOD
■ •
B •
44.96
IDS4J0
29.95
IDS445
29 96
IDS4eO
•
* t
39.95
IDS560
■ 4 4
ft • •
49.96
SmartWare
2281 Cobble Stone Court Dayton, Ohio 45431
Sr 3/426-3579 DaalerlnquttlBt ImllBdl
POWER TO YOUR AIM
Treat Your AIM to a Quality Power Supply
1. Designed to Rockwell's specifications for the
AIM 65 (5 volts at 2 amps, regulated; 24 volts, .5
amps avg., 2.5 amps peak, unregulated).
2. Overvoltage protection to protect the expensive
circuits in your AIM (5 volt output).
3. Handsome all metal case (two-tone blue),
4. Fuse (externally accessibfe), switch, pilot ligfit,
line cord, cable from power supply to AIM — all
Included.
5. Conservative thermal design for long life.
6. Special on orders postmarked in August or
September. $59.95 plus shipping (5 lbs.).
{Regularly $64.95.)
CA residerjts add 6% sales tax.
VtSA/MC, cashier's or registered check.
Personal check (allow 2 weeks 1o clear).
CompuTech
Box 20054
Riverside, CA 92516
U'
GET FREE SOFTWARE FOR YOUR APPLE!!!
HOW? Just order any of the items below, and for every $100 worth of merchandise order an item
from the Bonus Software Section at NO COST! CO.D. & Personal Checks accepted for all orders.
y.'
HARDWARE BY APPLE
APPLE II PLUS, 4811 1199
DISK DHIVE+CONTHOLLER (13) 535
DISK DRIVE only 445
Language Svnem w, Pascal 3B7
Silentvpe Priffter St Interfacfi 549
IntegET or Applesoft Firmware Catd 159
Graph ka Tabfet 645
ParallelPrinle'lfiierfaQeCSrd 149
Hi-Speed Serial Card 155
HARDWARE by Others
HAVES MICROMODEM II 300
VIDEX VIOEOTERMBOW. GRAPHICS 320
MiCROSOFT Z80 SOFTCARD 269
MICROSOFT I6k RAMCARO 159
CORVUS lOMa HARD DISK CALL
SSM AlO SERiALJPARALLEL AST 189
MICRO-SCI Disk a Coniroller 495
VIDEO MONITORS
SOFTWARE by Others
Leedei-Video-10017" BfiWw/Cable
139
PEACHTREE BUSINESS SOFTWARE
CALL
Leeden 17' Green */Cable
165
VISICALC
120
LredEi 13" COLOR MONITOR & cable
399
EZ WRITER PROF. SYSTEM
329
APPLE FORTRAN by MICROSOFT
159
APPLE BASIC COMPILER by MICROSOFT
315
SOFTWARE by APPLE
APPLE COBOL by MICROSOFT
MUSESUPER-TEXTII
599
139
lyPLE FORTRAN
159
PROG RAUM A APPLE PIE
119
APPLE PILOT
125
HARDWARE
PRINTERS
by Mountain Computer
EPSON MX-80
SIS
Clock/Calendar Card
Z39
EPSON MX 70W, GRAPHICS
415
A/DSD/AlniEtface
319
CENTRONICS 737
737
Expansion Chassii
6K
NECSPINWRITER 5510 RO
2795
ROMp Ins Card
135
V^STA V300 DAISY WHEEL 25CPS
1750
Mark Sense Card Reader
995
VISTA V300 0AIEY WHEEL 45CPS
2025
BONUS SOFTWARE HERE!
LSI ut •miiaJnT you milh MESSAGE-MAKING SOFTWAPE.
Ju«I Dtsc* If Qitk in The APPLE, snlv Iha lent, and cotaritil.
dyiumlc n>0iiBge« ifipaBr at Ihe icreeni d' TV iqH cDnr>«c1*d (O
Uia CDrnpurer. Uh Ihs urflware Id brnjadH^Bit matlBatt f^ TV
•crasni In ichoali, haiuibil^ iBcTOrl*!, US'-* nlrtdOiAl, «Hhlblt
tHjOf^^ tic Tn» foJIOWlna pri>o'tf ■> OW lATa«t r«l«*aa:
SUPER MESSAI^E; €■»»> TMugat In fulL-paga "chuirk^'.
Each ni*l»Q4 tHowt nattntanli □! mlKflil tv^mlr'"". tyoti\Itt
mta calory In mliad uppai and lowsr laM. STyl** rinfft from
ratfulai A^PLf characlBr^ up to dOubrv-t^TV, dOu b t*- wid| h char-
•ciari wirn 4 n^aw, Dord 'ont sik calory mty IM uaad 'or nch
dllfei^nr ii/pWyt*- Vflr1lc4l and horlraiLtal cflitUrlng are aval'B-
tile, and Aprd-MTap It tUtdTiatlc, Ummii can chain pi^i IDfltHXT
to Tiaka nulltpBga maiaaifiL Pa^i can ba a^incvd jmnually
Dt aulDmallcaMy. MulT^paaa irmugti can b« ilOFad TO dllC W
r*c«llH Intiamlv.
REQUrPES ^K & ROM APPLESOFT - - - ■ » Bft
APPLE PLOTS VOUP DATA & KEEPS VOUH HECOUDSTOO
APPLE DATA GRAPH 2,}^ Ploti up U ^ lupvlmpOHd curvvi
on tiM Nk-rai Scraan both Iha K ft V ■««■ l^I mani)On«d. E«cti
curva conilali a* up AO 170 p4*ca* of dftU. Oraphi an t« ttora*!
U diK and iBcallVd I m rr^Dd l«n iy for uodallno- Up to 100 (fr«ihi
can f* irOfOd on ^n« »iTi6 dlic Graar "or SlOCk-m«rha1 Charting,
BnjtJrhMa VaxogamsriT, and Clafaroom Initructlonl
REOUIRES 4H K 4 ROW APPLESOFT.. $ 4a
APPLE RECORD MANAGER: AIIdivi compbata Ulaa 10 H
brooghl tnia mamotv lo Ihal raoord laarchaa and ma nipu Fn hon >
■r* lifUniahaout ^acofdi wLthIn any Ml* can conuln up io
30 fIvUK wiTh u»ar-daflnad haadlnpi. In^D'ir^llon etn pa alfinff
Cf numarlc Uiart can blOvvsa Thru fllH ualng paga-forward. pao*-
backAird ar randDTn-Harch oomrnandi, fSacordi can aalliy b*
^chad, aFiaiBd or Ipriad at a]IL FlFai can ba BTDfH on iha
vmadrtvVat Itie riLBiiar program, Oi On anoihtr. If a tmcornl drlwa
davairabla, nacordi or f llaa can ba pdKHd, fl datlrad-
AnHlTlpnal FYKHlulaT corntna Bfa a STATISTICS INTERFACE,
CHECKBOOK, MAlLfNG LIST A DATA-ENTRY.
REOUIHES *BK & ROM APPLESOFT-, ------.---... ( 3t
- AM Soltwara »0«B on Qhl. Tor Af-I-LE DOS 3,2, Cflnnj arllbia
IO 3.1
CONNECTICUT INFORMATION SYSTEMS CO.
218 Huntington Road, Bridgeport, CT 06608 (203) 579-0472
4^
MICRO - The 6502/6809 Journal
No. 40 - Seplember 1981
%
/MCftO
Updates
and Microbes
Chailes Schwarz of Bethesda,
Maiyland, sent this note:
I was very annoyed to discover that
the assembly language program by
Steve Emmett on pages 38-39 of your
fuly, 1981 issue |38) has been cut off. I
very much enjoy reading about well-
tested assembly language programs in
your magazine, but errors such as this
one make the reading very difficult.
We regret QUI mistake. See Emmett' s
listing below:
OSDl 8D1008
STfi BUFHl
08D4 EE1208
INC EWE
EHS TO WRITE EmiDBll Listing
0eD7 AD0EO8
LEfi CTRK
oam 8O1708
SIA IBTEK
08EE ADOE08
LDfi CSCT
08E0 BD1808
HTA IBSECr
08E3 Mil 008
Lm BUFHl
0EtE6 SDicoa
b'lA IBHUih
0BE9 AD120e
ll». I*JS
08EC 8DlF0a
STfi IBOO
08EF 60
Rm FTs
08F0
OBFO MOl
EBT Lm #501
BESET TBWPORRRI
08F2 SCOFOe
STA a;io
STORW3E AHD
OBFS 8D1108
STfi KTFK
lOB TO
OepS 8D1208
STfi EVJS
INITIfiL
oera SDiFoa
STA lEOff!
CCMDITICNS
08FE ft903
LEft #503
0900 8EOD08
SIS CTKK
09O3 BD1708
STA IBTEK
09O6 ADCCOG
LDA BUISB
0909 SD1008
STA BUFHl
□90C 8D1C08
STA IBajITf
090F fi900
LDA #S0O
0911 8D0E08
STA cscr
0914 801808
STA IBSECT
0917 603008
STfi IGSTTVT
091fl A90F
LDA #50F
Si:r BSD EtA3
091C BD280B
SIR FLAG
091 F 60
RFS
BSD
[obn Martin of Cleveland CIP by
Heights. Ohio, called to tell us of an (38:68j.
omission we made from hsting 1 of follows:
Monobyte Checksum Dumper for
Petei Bioeis
The rest of
in MICRO
the hsting
B roars
Listing
lEDF 20E71E
MxajT JSR HEXCOT
rSUBROrriNE TO HIMP fi BYTE AS
1EE2 A90D
Uft SSOD
.■2 HEX DIGITS + CR, I.E.
1EE4 4CB1FC
JHP EfiVHOT
."MTHTTnn tnanoRr.F mnMBT"
1EE7
■
1EE7 48
HExa/r PHft
jSUBROJTINE TO PKItrr {PUD SAVE) BOTE
1EE8 4fi
LEE
;AS TWD HEX D-IGITS
1EE9 4A
LSR
]EEfi 4A
1£R
lEEB 4A
LSR
lEBC 20F01E
JSR DIGCUT
lEEF 68
Ptfi
lEFO
lEFO 290F
DIGOUT AND #SOF
lEUBRCWriNE TO FRIWr (AND SAVE)
1EF2 0930
ORA #S30
rfl HEX DIGIT
1EF4 C93A
CMP #S3A
1EF6 9002
BCC *+4
1EE8 6906
fiDC #506
lEFA 4CEEFF
JHP BiTCUr
Wazten Ward of Alberta. Canada,
senLanother update to the Supeiboaid
article.
For CIP and Superboaid owners
who want to use Edward H. Carlson's
mini-assembler (MICRO, March 1981],
here are a few line changes that suit his
program to the smaller screen format:
1 FOR X = to 25:PRINT:NEXT
X:GOTO 1990
20 FOR Z ^ 2 TO LEN(C$) : POKE
N-l-Z, ASC(M[D$(C$,Z,1)):
NEXT; RETURN
99 0$ = ■■No":N = Q + 1 iGOSUB 20:
100 PRINT:PR!NT AD;:INPUT CS:
PRINT" >-±S = LEFT$(C$.3):
L^LEN(C$)
106 IF L$^"ASC"THEN M = ASC
(C$):Z^ 1:G0SUB 2: GOTO 100
1995 = 54084
4050 N = N + M'LL^ L/16:NE>a:C$ =
STR$(N):N^Q:GOSUB20:
GOTO 100
Line 1 is cosmetic — it scrolls the
screen for a clean start. Line 1995
relocates assembler comments into the
CIP video memory, and changes the
other lines to reposition the comments
so they'll all fit on the screen.
It's impossible to squeeze a full
comment sequence legibly into the
same 24-character line as the command
input, so the third PRINT statement in
100 starts a new line, preceded by a
"greater- than" sign, beneath the ad-
dress line. The first PRINT in 100 puts
a space between each pair of lines for
greater readability: to fit more informa-
tion on the screen, leave it out.
The display resulting from these
changes is almost as easy to read as the
original. Users will still have to keep a
notebook handy, though, if they want to
save the assembler's translation before
it disappears off the top of the screen.
No. 40 -September 1981
MICRO - The 6502/6809 Journal
93
Cliff Harris of Anaheim, Cahfomia,
wrote about bis update:
I was intiigued by Edward Carlson's
6502 Assemblei in BASIC in the
March, 1981 issue of MICRO. I thought
if he could adopt the program from PET
BASIC to OSI, then I could transform it
into something my Apple could under-
stand. See listing 1.
Listing 1
1 HOME: GOTO 1990
99 C$ = "NO": N=Q-I-18:GOSUB20
100 PRINT AD;: INPUT 0$: L$ =
LEFT$ {C$,3}: L = LEN{C$): Q =
Q + 128: IF Q > 2000 THEN Q
= Q - 984: IF PEEK (37) > 20
THEN Q ^ 1888
106 IF L$ ^ "ASC" then M ^ ASC
(C$): Z ^ 18: GOSUB 2: GOTO
100
221 II = OP + 8 *(CA ^ 1)
340 N = N - AD - 2: IF N <
-128 0RN> 127 THEN PRINT
■'CAN'T BRANCH "; N; " -TOO
FAR":Q = Q + 128
1992 DEF FN H{D) = D + 48 - 57 *
(D> 9)
1995 Q = 912
2029 Delete this line
2030 AD = 768: GOTO 100
4050 N = N + M*L:L = U16:
NEXT: C$ ^ STR$ (N): N ^ Q
+ 18: GOSUB 20: GOTO 100
Line 1 cleans up all the garbage on
the screen and sets up the screen for-
mat. This is necessary since the hex ad-
dresses and commands are POKEd
directly into the screen memory.
Lines 99, 106, and 4050 move the
output from the assembler to result in a
format that will fit on the Apple screen.
In line 100, the changes are required
because of the way the screen locations
are arranged in the Apple, Adding 128
to a screen location moves it down one
line, unless you're on the 8th or i6th
line. Then you must subtract 984 to
move down one line. The Q = 1888
sets the screen into a scrolling mode
once you reach the bottom of the screen.
Line 221 required a change in sign,
The minus was changed to a plus. In
line 34 I added "-TOO FAR" here to
make the message more meaningful.
The Q = Q -H 128 moves the line posi-
tion down one so that your next pro-
gram line won't be printed in the mid-
dle of the "CAN'T BRANCH..."
message.
In line 1992 I changed the 7 to 57 to
get this line to work with the Apple. A
side effect of this is that the hex por-
tions of the program will be printed in
the inverse mode. If you want to take
the time to massage this function, you
can get a display in the normal mode,
or even flashing, if you're so inclined. I
left it this way to minimize the number
of changes in the program.
In line 1995 the number sets up the
screen location where the output from
the assembler will be printed on the
screen. When 128 is added by line 100,
you will be on the top line of the screen
16 spaces from the left (912 + 128 =
1040, which equals 1024 + 16).
Lme 2029 can be deleted, as it
seems to be left over from a decimal-to-
hex conversion routine which is no
longer part of the program.
In line 2030, AD = 768 sets the
starting address of your program to
$0300. You have only 255 bytes
available before you run into the screen
memory at $0400. If your programs are
going to be longer than 255 bytes,
change AD to 8192 i$2000], or
whatever address suits your needs, to
get into an area of memory with no
conflicts.
If you want to add a "user's
manual" to the top three lines of the
screen, change line 1995, and add lines
1996 through 1999 (listing 2|,
Listing 2
Change the following lines to add a,
"menu:" /
1995 Q = 1296: POKE 34,0: HOME
1996 INVERSE: PRINT "ADD";:
NORMAL: PRINT "NEW
ADDRESS";: INVERSE: PRINT
"CON";: NORMAL: PRINT
"STORE CONSTANT'
1997 INVERSE: PRINT "DIS";:
NORMAL: PRINT "DISPLAY
MEMORY";: INVERSE: PRINT
"ASC";: NORMAL: PRINT "ASCII
EQUIVALENT"
1998 INVERSE: PRINT "HEX";:
NORMAL: PRINT "CONVERT
FOUR DIGIT HEX TO DECIMAL"
1999 POKE 34,3
The POKES set the text window so
that you can clear the screen (line 1995)
and so that you won't lose your
mnemonics when you get to the bot-
tom of the screen (lme 1999).
EiicR. Bean of South Bend, Indiana,
pointed out this omission:
My letter to the editor in July, 1981
on page 19, mentioned a figine 1,
which was not printed. Here is another
copy of the clock oscillator fix for the
early KIM-1 uP board (see figure 1].
ii
a
10 PF
(ADD)
U16 ute
13 I,. 12 11 ^^ 10
H>o
I
+ 5
(ADD)
^
'J^
330K Y
(ADD) I
D2
(ADD)
~JS2
(ADD)>4
I
\UFT XTAL FROM BOARD
{ONE LEAD)
gf^
figure 1: Conversion □( early KIM-1 XTAL oscillator to later production
circuit to Insure sell starting.
94
MICRO - The 6502/6809 Journal
No, 40 - September 1 981
::
^ >lpplell
seRsatioRal
software
GPeafetve
GOIRpatlR(g
software
Space GameS'l
Casselle CS-dOOl 111.95 * orograms Reauires 16K Apple II or Apole U Plus
Saucer Invaaion. Fire missies lo destroy RodterPilor.ManeLivervojraEaceshiDOver
Ihe invaders i^ho lly a1 different speeds Ihe mountain using horizontal and vetfical
and amtudes ihrusiers
Star Wars. Shoot down as many TIE lighlers Dynamk: Bouncer. A colorful *iver-changfr»9
as possible in 90 seconds graphics demonslralior
Strategy Games
Gasselle CS'4D03 SI i 95 4 Programs Requires iBKADPle II or Aople II Plus
Kodtada. Build a wall to trap your appoEtenC UFO. Use lasers, wartieads or guns todes-
bul doni rtil anylhing Iroy an enemy ^>3cecratf
-SiES tfe?i¥«* ""■'" "■ '■ '"■
' ElhCINVrTI tH-i
SItuiTk. A ^-player siralegy game pfaved Genius. A lasl-movlng Irivia quiz wilfi Kores
with dice, S^ill and luck. ol questions
Sports Games- 1
Cdiiprii.' CS-(O0^ SI 1 9S i progrdms HeQuirL't 16K Acole II ur Apole II Plus
Brain Games
Cas^ello CS-400.; sn 95 ■' prDyrams Requirp^ ►bK Appli? II or Appio II Plus
^^^
1
2
3
C
4
B
D
n
^^"
Baseball: A 2-aisyer game wilh mlching Breakoul. Four skill levels and improved
bafling rielding slealng ana double scoring make (his Ihe best breaKoul eve-r
0lay5
Dodgsm.BethefifstlomoveallyourcieceE Nuclear ReagtiDn A lyame ol skill last
across (be boa'd in ihis inlnguing sirategy decisions and qinOi rpus^rMl^at oosilinn
game ^^^_^^^^.^^_^^_^^ ^^^^^^^^^^^^^^^^^
rt''-"U»r™-r''_.
f R
T
V )
F
G
H
U
B
H
IH^^^^^^
(^
-..^Ik
Torpetfo Alley. Sink as many warships as tJarts. Use game paodles lo cortroi tne
possible in 2 minuCes Ihrow ol s darrs
Pairol. A Simon-Type game wilh letters ano Midpoints anO Linos. T'^o colorful graphics
tones Dueling digits is a version wilh num- Oemonsl rations Tones lets you make music
bers and sou no etlects
Space & Sports Games Strategy & Brain Games
Order Today
DiskCS-4S0i S34 95
Requires 32K Apple II or Apple II Plus
DiskCS-450J S24 95
Requires 33KADDle II or Aocie II Plus
This disk coriains ail eight games Irom Thisdisk contains all 12gamesand programs
cassettes CS-4001 and CS-4002 from casseiles CS-J003 and CS-400J
ih ajp r Cnm[K,ir- i
To order any 0' these sol Iwa re packages
send oayfnent plus SJ 00 postage and
handling per order to Grealiye Compuling.
Morris Plains. NJ 079 5 tj Attn' Clarice
Visa MasterCard and American Express
orders niay be called in toll-free
Order loOay al no risk IF you are no!
complerely ^lisfied your money All I ^e
promptly and couneously refunded
Crealiue Compuling Software
fjl orris Plains I^J 07950
Toll-free aOO-631 -81 12
in t^J. ?D1-640-0445
creative compufclRg soFfewape
No. 40 - September 1981
MICRO - The 6502^809 Journal
^
PET a APPLE II USERS
Tiny Pascal
graphics
The T1NV Pascal Syalem lums your APPLE M micro into a 16-bM P-machirlfl. Ydu
loo can leam ih« tanguage EhBi Isslaisd 10 becomoiha aucceaaor la BASIC. TINY
Pascal ollarg tho loLIOAjng'
' LINE EDITOR to ci«a1«. modify and maln»fi> tourc*
' COMPILER lo produc* P-CDdt, 1h« HHrnblv langAuagt ol Ih* P-fludlbl*
■ INTEHPDETEH In aiKula thi compMid PcdBb (ha> TRACE)
* SInicturad ptegranimad conalnicli: CASEOFELSE. WHILEDO, tFTHEN-
ELSE. HEPEAT-UNTIL, FOHTO/DOWNTODO. BEOIM£ND, MEM, CONST,
VAR AflflAY
Our new TINY Pascal PLUS* providea graphica and olliar buihm luricElanB:
GflAPHICS, PLOT, POINT, TEXT, INKEY, ABS AND SOH. Tna PET version sup-
port? double density plolUng on AO column screen giving &tx50 plol oositlons-
The APPLE II veralort supports LORES and lor ROM APPLESOFT owners (Me
HiflES graphics plus oinar Isaluras wnlt COLOR, HGRAPHICS, MCOLOR,
HPLOT, PDL and TONE For Ihosa nrho do nol reouLre graphics capaOiliMes, you
may aim Older our original Tiny Pascal pachage.
rNYPaiulPLUSt GRAPHICS VEflSION-
PET aSK NEW Boms oasselle «SS
PET 32K NEW Roms disfcstis »50
APPLE li3S«/4aK»JOOS3.S or 3.3. t50
TINY Pascal NON-QRAPHICS VERSIONS-
Pfl iaK/32K NEW Romscassella «0
PET leWaiK NEW Boms diafcalla M5
APPLE II wIROM Appiasoll 32K w/DOS MS
APPLE II w'RAK ApplsSOll 49K WlOOS tX
USER'S Manual (ralundabia whli aolEware ordar) ^10
35a2AesemB>rUEtlngonNTERPRETER,grapnics t^S
a50!*S9ambiy Lisling ol INTERPRETER non graphics. .(20
FREE pailai^ » US «n4 CAhADH Qt9ftlf*f H cnpiia □' fty
QlKnH' t^ (■pimuti 4M1aJ Mldilgm rHKtonli ■nclW* 1^ tlol
nplH] na rkit SOURCE CLQtU
naMtfr Lharye
iBHimm
i
ABACUS SOFTWARE
P.O. Box 7211
Grand Rapids, Michigan 49510
(616)241-5510
THE ultimate in SPEED and
language POWER for the APPLE H : '
THE INTEGER BASIC COMPILER
SPEED inPROVEMENT BY A fACTOP OF 10 TO 2D OVER
Apple's BASIC inteopbeter - 15 to 30 over Applesoft!
No language card necessapy !
Optimize code fop your speed/space HEoumtHENTS,
Object code and run-tire system ape completely
relocatable - USE MEMOPY the mv YOU MiNT TO !
Many powerful BASIC language extensions:
- Full strins length of 32767 - no 255 limit !
- CHRt, GET AND KEV functions.
- Direct Hl-RES ehaphics support,
- HOflE, INVERT, NORMAL, FLASH, and more I
Many applications - existing integer PR0GRAW5
CAN BE EASILV CONVERTED TO RUN ON ANY APPLE II !
Compiler reouires: Apple II (or II plus hiih
integer or language card), us k and dos 3,3,
Supplied on 2 disks with complete documentation,
Ppice; % 149,50
Dealer Inquiries invited
(Cilif. iild t.51 5ilei la". Foreign iild J5.00 sir ih(1)
GALFO SYSTEMS 6252 Cahino Verde
San Jose, CA 95119
• *&ple» Applesoft - Trademarks o* AppU Cflapulfr U>.
^rendipity
Hath Tools
br your
^^pple n "
INTER-STAT'" offers you a full range of inicractive Malislical
analysis lechniques. from averages and medians lo binomial
and poisson ijistribuiions, corrclalion coefficients and one- and
iwo-way analysis of variance. SI69.
ADVANCED MATH ROUTINES is Ihc maihemalical looi kil
(or common, yel complen numerical problems. Roulines include:
linear regression, mairix operalions, numerical calculus,
differential equalions and dala scl recall for ilerafive calculalions.
SIM.
Thoroughly lested, well documenled and easy lo master, each
package includes a 30+ page self-leaching manual.
Serendipily's complete line of software solutions for business,
education and professional applications are available al your
local Compulerland or Apple dealer.
For a free hrochure. or lo order direct contact Serendipity
Systems, 225 Hlmira Road. Iihaca. NV 14850.
Phone 607-277-4889. Visa and MC accepted.
'"Apple Computer
SERENDIPITY SYSTEMS
6800/6809
SOFTWARE CATALOG
PHOGSAV
liNCUACC
08«CI
lv/SOUJ?CE
ON DIS<
X FOflW
4W9/MM
■■'JFJ9 95
t>a farr^OI
Tie iJASIC
J)-9»5
DalaianiJ
rscrsASiC
J? 95
■Bill Payt'
7SC XBASIC
'
Si>9i
rSC XBASIC
19 1i
rSC XBA^tC
49 9i
Alt Ihrml
ISC laaiiC
F 69.95
&a>.l PtfiQ Too'ii'
flaw AS^^a
>J9¥i
69.91
r^iiwo'd P'tflttl-e"
rteo9 A^j^5
65.0S
80 9!
EiPrnded mMivi
iflOff ASMS
J«.M
49. M
Job ConfrnJ Prtig.
6B00//i9O^ ASMB
49.?i
89 95
Eirhrj
6800.660^ ASWfl
39 f 5
59.95
ftnfd'wt'
650016609 ASA^A
iJ9S
7*.95
Hflp
I1SM/480B Aiwe
15 5S
Jfl.flj
Dvnfijall PoKfl
6B09
59.95
- B9 9S
Pier
Swod TR^BO lapei
T5C XflASiC
6eQ9 ASMB
" 9>
54 95
S«p«r iJCLTFh
6eOO/i909
99 00
ZSO Svp^r StK^'h
6eoo;6B09
9900
Ooil AiicmbiBfi
MACBOS (OS Tie iSD? ASHB
EA. *9 95
68M1; 1 ifiOi. OiD!
zso soeo;s i lo
99.95
Vaili'-S I'i'
rsC IBAS(C,'4fl(W
«M
FoiTiL Diiplfrf
TSC tfflAS^C/OfltfP
J9.«
Tabuto Pcia
TSC XfiA^iC
100.00
■■ SOUSCf AND IfEPRODllCllOn UCeN^IOJNtMt ONIY.
" -totluiitJ B-BiTrhin6
bv' iJkfl [(,<■
U.S. A, add $2.50 for Standofd UPS Shipping & Handling
Fo'B'gr^ ora
ers add ]0% Sur
face, 20% Aitmail.
Specify 5" or fl" iiie d'sic ond '' fo' 6800 or 6609 iystem.
OUR SOFTWARE
'5 i^cmx
COMPAmiE. -^^^
^^^^
^»
-~.*^?y
OS 9 VtRSiONS TO COME.
^^^^^
-
u
(frank HOGG LABORATORY, INC.
13D M1DIDWN PlAJi* - ^■'IIACU^,
r^y u^iQ 1
96
MICRO - The 6502/6809 Journal
No. 40 -September 1981
f
AMOK)
Hardware Catalog
Mike Rowe
34 Chelmsford Street
P.O. Box 6502
Cheimsiord, MA 01824
t
t
Name: Hayes Stack
S martin ode m
System: Machine
independent— RS-232
compatible
Hardware: Low Speed Modem
Language: Program controlled in
any language.
Description; RS-232 compatible, 300
baud data communications system for
small computers. Features program
control in any language switch select-
able options, full or half duplex and
LED status indicators.
Price: $279.00 (suggested retail]
Available: Contact address below
for nearest retail dealer.
Hayes Microcomputer
Products, inc.
5835 A Peachtree
Comers East
Norcross, GA 30092
(404] 449-8791
Name: Model 2100
Memory: Standard 2K buffer
memory; 4K option
Description: The Model 2100 is the
European version of the Model 2101
having a built-in CCITT interface. Like
the Model 2101 it also features: 5x9 dot
matrix characters with true upper/
lower case and true underscore/
overscore; standard 80/132 selectability
and bidirectional 120 cps printing.
Price: $1385
Available; Computer Devices Inc.
(early 4th Quarter; 60
days ARO|
25 North Avenue
Burlington, MA 01803
(Call: 1-800-225-1380)
Name: W7AAY 4K RAM Board
System; Synertek SYM-1
Description: Double sided reflow
solder plated printed circuit board
mounts on SYM-1 over Synertek name
and logo. Allows memory expansion up
to 8K using 2114 RAMs. Full instmc-
tions included.
Price: $8.00 ea. plus SASE
Available: John M. Blalock
Blalock & Associates
P-O- Box 39356
Phoenix, AZ 85069
Name: Atari I/O Package
Description: The four ports on the front
of the Atari computer connect directly
to a PIA for use as output as well as
input. Atari owners can build custom
program controllers, interface to home
control circuits, etc. The I/O package
comes with 4 nine-pin connectors, 4
twelve-inch lengths of nine conductor
ribbon cable, and documentation. The
documentation includes examples of
home-buik program controllers, how
to access the ports through BASIC com-
mands, shadow registers, or directly,
and how to set-up and address the ports
for output.
Price: $18.00 order #H309
Available: Mosaic Electronics
P,0, Box 748
Oregon City, OR 97045
Name:
System:
Memory:
Language:
Hardware:
Available;
Universal Analog
Interface Card with A/D,
Clock and Memory
Expansion
AIM-65, also applicable
to PET, SYM, KIM and
other 6502 and 6800
systems
4K to :6K
BASIC or Assembly
AlM-65 or PET, SYM,
KIM and other 6502 and
6800 systems plus
Columbus Instruments
1B-902-AB Card
Columbus Instruments
International Corporation
950 N, Hague Avenue
Columbus, OH 43204
Name: Flexi Plus
System: Stand Alone or Apple,
AIM, SYM, KIM
Memory: Up to 56K RAM, ROM
and EPROM
Description: Multi-function board in-
cludes floppy disk controller for 8" and
S'A" drives with IBM formats; IEEE-
488 bus controller; RS-232 communi-
cations interface; 20 mA current loop
interface; parallel and serial I/O ports;
cassette interface; up to 56K bytes
ROM, RAM and EPROM; and a 6809
microprocessor. May be used to expand
existing 6502/6809 systems or as a
complete singie-board microcomputer.
Price: $695 with all options
and 4K memory
Available: The COMPUTERJST, hic.
34 Chelmsford St.
Chelmsford, MA 01824
(617| 256-3649
Name: Covos Model 1 Voice
Controller
Language: Human Voice Input
Description: Tolerant of noise and
distortion, a revolutionary self-
contained speech recognition processor
accurately identifies voicing existence,
voice fundamental pitch, voicing dura-
tion, and vowel type in the manner of a
human listener. In the stand-alone
mode, this device will recognize 16
separate commands. When interfaced
to a processor, such as a 6502, the
system becomes highly flexible and can
he adapted for continuous speech
recognition, speech bandwidth com-
pression, speech synthesis, and aids for
the handicapped.
Price: $389.00
Available: Covox Company
P.O. Box 2342
Santa Maria, CA 93455
(805] 937-9545 or
928-4818
Name: UDS-100 Series Memory
I/O expansion boards for
AIM 65
Description: Two independent, baud
rate selectable, asynchronous, RS-232-C
channels and 20 independently program-
mable parallel I/O lines. Memory in-
cludes 4K bytes of IB-pin NMOS/
CMOS RAM and 6 24-pin sockets
accepting 1, 2, 4, or 8K x 8 RAM,
ROM, PROM or EPROM devices. Full
on-board bus signal buffering is included.
Memory IC's and battery backup optional
Price: $259.00 basic assembly;
$296.00 with battery
back-up
Available: Unique Data Systems, Inc.
15041 Moran Street
Westminster, CA 92683
(714) 895-3455
No, 40 - September 1931
MICRO - The 6502/6809 Journal
97
Name: Microlab
Memory; 2K bytes of user RAM
Language: Assembly
Description: Complete educational pack-
age that includes hardware, software,
and course materials for introducing
microcomputers and performing labor-
atory experiments. Analog- to-digital
coaversioa, interface for oscilloscope
graphics, eight applications programs.
Games, countei/timer, function
generator, transient recorder, cooling
curve and other applications
Price: $650 - $850
Available: Cambridge Development
Laboratory
36 Pleasant Street
Watertown, MA 02172
(617) 926-0869
Name: Microcomputei Control
System (MCS)
System: Rockwell International
AIM 65
Description: The MCS is based upon
the AIM 65 and is a complete micro-
computer control system. It features
three additional interface boards and
firmware for real-time recording and
controlling of external devices such as
switches, solenoids, lights and alarms.
Each MCS contains 16 input and 16
output channels that are rated at 28
VDC |at 3 Amps| and are completely
optically isolated and noise suppressed.
Efficient recording and controlling of
external devices is accomplished using
BASIC and intemipt-driven firmware
package. This firmware adds 36 real-
time commands to BASIC and allows
"foiegtound" and "background" pro-
gramming. While the MCS was
specifically designed for the behavioral
research psychologist it can also be
used in other applications such as
industrial control, alarm and en-
vironmental systems.
Available: Micro Interfaces, Inc.
P.O. Box 14520
Minneapolis, MN 55414
Name: CHIEFTAIN™ 98W10
Memory: 32K RAM (expandable]
Language: BASIC 09; Random File
BASIC; Pascal Compiler;
Cobol
Description: Smoke Signal, manufac-
turers of computer systems based on
the 6800/6809 processors, has in-
troduced the latest addition to the
CHIEFTAIN™ Series of computer
systems. Designated the CHIEF-
TADST" 98W10, this newest addition
to the higher end of Smoke Signal
Broadcasting's business computer line
houses a 10 megabyte 8- inch Win-
chester Disk Drive, The new system is
configured around the state-of-the art
6809 microprocessor allowing pro-
grams to run at twice the speed of any
other similar system. The wide range of
programs available for the CHIEF-
TAN™ 98W10 include OS-9 Level I
and Level 11 multi-user, multi-tasking
operating system. A standard CHIEF-
TAINTM 98W10 incorporates 32K of
RAM — expandable up to 1 megabyte
for specific requirements such as OS-9
Level n. The CHIEFTAIN^" 98WIO
supports an 8- inch floppy disk drive for
1 megabyte of back-up storage. A 20
megabyte tape streamer option is also
available. Dealer inquiries invited, dis-
counts available.
Price: $8695.00 base
Available: Smoke Signal Broadcasting
31336 Via Colinas
Westlake Village, CA
91362
Name: Terrapin-Apple Smart
Interface
Description; Terrapin, Inc. announces
a smart Terrapin- Apple Interface for its
robot, the Turtle. Now any Apple
owner can be one of the first persons to
own a robot. The interface enables the
user to conveniently control the Turtle
from a high level language (BASIC,
Pascal, Logo, etc.) via simple I/O
statements. The interface includes a
parallel port with software in ROM and
a power supply.
Price: $199-95
Available: Terrapin, Inc.
678 Massachusetts Ave.
Cambridge, MA 02139
iW
The Haidwaie Catalog announcements
are run fiee of charge, but are limited to
onJy one per company, each month.
If you have hardware you'd hke to
announce to MJCRO's leaders, send for
an apphcation form.
Hardware Catalog
34 Chelmsford Street
P.O. Box 6502
Chelmsford, MA 01824
JUCftO
1^1
DEPT.E-9 P.O. BOX 301 60 EUGENE, OR 97403 (503) 345-3043/NOON-7 PM
3>
SUPER DRAW S WRITE Fonts, drawing, and useful
utilrliea. 19.95
SUPER SHAPE DRAW & ANIMATE Die best system
yet, 11 works. . create and/or animate shape tables like
a dream. 39-96
THE CREATIVITY TOOL BOX Draw, write poetry,
music. Includes Action Sounds. Hi-Res Scrolling,
rou fines, shape tables and shape view program,
utilities, animation demo, and fonts. 3 disktuis, 88 page
manual. 44.95
BLOCK SHAPES FOR APPLESOFT OR ASSEMBLY
There is no package available today that gives com-
puter customers what thay want in the area of graphics.
The crying need here, according to our customers, is
for a learning pacl^age that quits ignoring the one sub-
ject that everyone seems to be trying to keep a deep
assembly fi machine language graphics I
APPLESOFT OH
ASSEMBLY package is chock full of programs to create
and animate all types of shapes, such as vector shapes,
block-shapes, HPLOT-shapes, text file shapes, data ar-
ray shapes, etc. Included in BLOCK SHAPES FOB AP-
PLESOFT OR ASSEMBLY are shape examining, shape
editing, shape drawing, music tone routines, vioiin
sounds, noise creation, assembly language sounds,
SUPERFONT and font using, and a Y TABLE for either
page of hi-res that allows extra speed in machine
language programs since you avoid the HPOSN
subroutine. Plus colorful roubnes. You may never need
lo buy another graphics package again. ..because you'll
finally have a handle on what ifs ail aboullH! BLOCK
SHAPES FOR APPLESOFT OR ASSEMBLY available
this fall (1981). 4 disks with over 200 pages of
documentation. TantatiKe price: 12S-00
Apple II 48K ApplSBOft ROM*
' Apple IS B Iradflmarh a1 ApFVe Ccrmputer, Inc.
^^^^1 for a learning package that quits ignoring the one sub- documentation. Tentative price; 125-00
^^^ ject that everyone seems to be trying to keep a deep ^ i^ „ ^^^ Appiosoft ROM*
■ dark secret, assembly fi machine language graphicsl -AppieisairMBmafHoi Apwecomcutef, mo.
■ ^_ The BLOCK SHAPES FOR_ APPLEjgFT_OR ^^^^^^^
^GAftDE CftEATlOMS
^-
MICRO - The 6502/6809 Journal
No. 40 - September 1981
'
1
Three minutes to find that "just right" property.
Search through up to 3600 property listings with Real-Soft
programs for Real Estate Agencies.
JJSJ I?EhL EST^IE -H^jEhC; SOFTUARE ilij
GOLDEN hCREftGE REhL ■ ■'
SIZE OF HOUSE-
STYLE CF HOUSE.
REG I ON.
ASKING PRICE-
rtPEH OF HOUSE.
GftRAGE CfiPROIT'i'-
CONSTRUCTED IH ■
DUPLET
SHflUGHHESSY
1393 SQUARE FEET
SIHGLE CSR
i9£0-- — —=---.--
*■ FULL EnSEMENT * EilTPA Ei^THROOMS
.^f^aia^ TO PPINf
iiiJ RESL Ei-TRTE AGEHCV SOFTiJftRE SM3
•
C-OMPARE nCiftTiifluE TERHS
PRINT.- SMORTISftTION ThBLE
ESTIdfiTE LOHN ChPhOITV
ChLi":ULHTE REPLrtCEtlENT COST
EDIT^-COHF GURE SYSTEfl
FORMhT Di^Tft DISKETTE
END' SESSION
PLEASE EHTER YOUR CHOICE
EETUEEN 1 hND 3
No need to flip through endless pages of listings to
find that "just right" property. Simply have your
clienl specify the price range, number of bed-
rooms, preferred geographical location, accept-
able house styles and up to 12 additional listing
features. REAL-SOFT programs will find the right
properties quickly and impressively giving you
more time to view the selected properties and
close the sale!
REAL-SOFT is an integrated set of computer pro-
grams designed specifically for real estate agency
use. All routines arc fully customizable to meet the
requirements of virtually any agencies. Up to 10
different house styles, 12 different lislJng features
and 16 different areas. Very easy to learn — in-
cluded is a complete set of practice data to experi-
ment with. Requires 48K Apple II, 2 disk drives and
monitor. Printer is optional.
If printer is used a printout of selected properties
can be output in only a few minutes for your client
to view and discuss in detail.
Other useful routines in this powerful set of pro-
grams include a Property Availability Report, full
Mortgage Amortization Tables (American OR
Canadian method), and a Mortgage Compari-
son Analysis Report. Then use still another
part of REAL-SOFT to estimate the replace-
ment cost of any listing (using local factors),
or to estimate the mortgage amount that
your client can qualify for!
Available at your local Apple dealer.
t
Apple II is a trademark of Apple Int.
REAL-SOFT Real estate software
1450 West Georgia Street, Vancouver, B.C. V6G 2T8
Telephone (604) 669-2262
BOI^-rWftRE iROFt OHIO BC: I EMT X F" I C
VIDEO EDITOfl
Videa Editor it 4 pa»*W<ii] ^ull 5crv«n cdi tor for d» alchas«l
DSI systens wj tn tfi" polled keyboard (except CIPI- Allow*
isill cursor-contr'oJ mi th tnaertion, delwtAon ar>d aupIicaliDfi
a1 source lar POSfC or OSI's fla sepib I er- / Ed . t or . Lhlihe
versions »«-i tteri in BASIC, this iBiachi n^-cod* editor i«
co-reskdent -»ith BASIC Cor the flsswpubler) , autolO'dmii inta
trm highest three pa^es o' RAM upon CflQt. Video Edk tar Also
provides single-tev^trDhB control o' mound, screen *or«At.,
COJC and hackgraufid color. Eight^incn or Hini di«V:
tl4,^3, Spec.iy amount o* ftAfl.
SDFT FPONT PAWEL
Soft Front Panel is a softwJi-» single-stnoC"". s 1 o.*-«t eppeF'
and dflOuQgDi — einulatar that perm ts e^sy d»v«lopeent a* 6502
■achin* cad4- SfP is a t^ntastic i-o<iitD(-, «i«il taneously
displaying aJJ registers, #ljqi, Ihe stack and MDre,
Address trap*, opootfe traps, traps C*n nerory content .and oo
port and stack activity are all supported. This I* for disk
systems "ith polled heyboard and CPlor (bb-« poom tor akt .
Uses spund and COlor capabilities of OS! C7/C4/CB sytttfis
<nDt for CIP). Elflhl-inch or mm d.sh *2*.95. Specify
««iount Dt RAM, H^ni^^l only* *4.95 ("ay be later credited
toward softk-are purchase)^ Biic page brochure available t/^*e
upon request.
TERHIMAL riDNTPOl- PRDCHOtl
OST-TCP JB a «opr«lat]cated Terminal Coritrol Progra" *or
■ditmg OS-b5D3 tilvs* and tor uploadiniT and do-anlcading
t^esB files ta Otha^ CEWiputers through the CPU board's
■trial port un DSI C2, C4 and CO disk-bA«ird systeias with
polled teyboards. Thirteen editor coanand* allow Jull
#dl t ing of f 1 lesp including commands for senQIng any tent
out the termnal port and saving wTiatw^r te-t comes back.
INDUTL utility included tor converting betxeen PA51C source
And TCP file text. Eight-xnch or eini diSk •39,95. Hartual
only, •^.95.
OSl-FDFJTW 2.0 / FIS-FOPTH I. I
DSH^OflTH 2.0 IS a full i mp 1 «-i*n t at i on n* the FORTH Interest
Group FORTH, for disk-based D&l vystenB CC1.C2.C J»C4»CQI .
Punning under DSb5D3, it include* « resldetit tent editor and
^302 as**^ler . Dver one t<undr«d pages of docunvn t at i on and
a handy reference card ^r* provided. Requires 2aK I20K CiP).
Eight-inch or Mini dl Ak •79.93. Manual only, •9.95.
-OSl-FDflTH Letters- EoftHare support newsl*tt*r •I.OO/year.
All price* postpaid. Florid* residents add ^nt taa. Dealer
inquineB are invited. HI 1d« iff days ftir delivery.
WRITE FOR FPEE CATRI.QG
□F SOFTWARE AND HIifiDHARE
FOR OHIO SCIENTIFIC I 1
I
Technical Products
P.O. BOH 12903 Un
Oairwsvi lift. >^lori
Coavany
Lv. Staticn
la 3Z&04
Rat Rate
DISK DRIVE OVERHAUL
One Week Turnaround Typical
Complete Service on Floppy Disk Drives.
FLAT RATES
8" Double Sided Drive S] 70.00*
8" Single Sided Drive SiSO.OO*
5'A" M-P.l. Drive SioO.oO*
'Broken. Beat or Damaged Parts Extra.
You'll Be Notified of
1. The date we received your drive.
2. Ajiy delays and approximate lime of completion.
3. Date Drive was shipped from our plant
4. Repairs performed on your Drive.
5. Parts used (" and description).
6. Any heipful hints for more reliable performance.
90 Day Warranty.
Ship Your Drive Today.
Write or call for further details,
PHONE (417) 485-2501
FESSENDEN COMPUTER SERVICE
1 16 Pi. 3RD STREET OZARK, HO 65721
pet a apple ii users
Tiny Pascal
GRAPHICS
The TINY Pascal S/tlem lums yojr APPLE II micro inlo a tti-^ll P^fnachlns. You
iDOcan iMmlhHlanDUBgelEiBMsalaledToOocoFnelF^asuccoa&Of 10 BASIC. TINY
PaacBl allflrs IhB 'Dllowing'
* LINE EDrrOR Id cr>al«, nwdlly and milntiln aoum
- COMPILER Id p>k>ik;> Pcodi, tha UHnibty lanB*u« <>< tlH P-michllM
* INTERPRETER 111 «>Kula in> compllMJ P4«l* <lu> TRACE)
* Sliuclund progrsnimM conilnicli: CASEOP-ELSE, WHILE-DO, IPTHEN-
ELSE. nEPEAT.UNTIL, FOHTOflMJWNTO-DO. BEOINEND. KEH. COHSr.
VAR ARRAY
OuE new TINY Paacal PLUS* pmvldsa gfaphlca and othar buiUIn functlona:
GRAPHICS. PLOT. POINT, TEXT, INKEY, ABS AND SOB TtlS PET vefsion SUp-
porls doubia cJenelTy ololMng on AO column screen giving SO a 50 plol pcsiElons.
The APPLE It version supporTe LORES and lor ROM APPLESOFT owners Ihe
HIRES graphics plus otner lealuras with' COLOR. HOnAPHICS, HCOLOR.
HPLOT. PDL and TONE For ihosa who do not require Qi^nlca capaoilltlea. you
rney still order our original Tiny Pascal package
T<HY Pueal PLUS. GRAPHICS VERSION-
PET 3!K NEW Roma caesatle. MS
PET32K NEW Rome diskette (50
APPLE II 32K;4aK «IDOS 3 2 or 3.3. tSO
TINY PllCil NOK.QBAPHICS VERSIONS-
PET I11KI32K NEW Roms cassette MO
PEnSK;32l< NEW Rome diskette (35
APPLE II wyHOM Appleaoll MK wfDOS 135
APPLE II -rlRAM App(eao(t 18K"/D0S J35
USER'S Manual (reliinOablBwIlhsottviareoiOar) 110
6602 AiaamDIy Usting ot INTEHPHETER-graphiCS 125
eSOZAastmail Lleling ol INTERPRETEP-non graphics. . HO
FACf tota^n US ■ndCin^D* Onm m>t b* »nit>ld glCr WHGIfO IHieJiitH Utfl
EHUBdvUTKE&aiRCE COaiJ
ll?»IT»I!I!ll
ABACUS SOFTWARE
P.O. Box 7211
Grand Rapids, Michigan 49510
(616)241-5510
Uecision
OyBtems
Daciaion Syttams
P.O. Boa 1300e
DsntDn, TX 7GZ03
SOFTWARE FOR THE APPLE II*
ISAM-OS is an integrated sel ot Applesoll routines inal gives indo 'fid file caoabilities
lo your BASIC programs Retrieve by key. na.lial key or 5cauenliallv Space Iroti
OelerM records is aLjlomatically reused Capabilities and perlormance thai malch
products costing twice as mucti.
SSO Disk. Applesoft
PBASIC-DS IS a sophislitaled prepiocessor tor structured BASIC. Use aduanced
logic constructs such as IP ELSE . CASE. SELECT, and many more Deuelop
programs tor Imeger or Applpioti Enjoy the power of siruclured logic at a Iractior. of
the cost of PASCAL
S3S. Disk. Applesoft 14SH. ROM or Language Carol
OSA-OS IS ti d IS. assembler lor S502 uolle Now you cao easily disassemble any
machme language program lor Ihe Apiile and use tlie dis assembled code directly as
input to your assembler Ois- assembles insrructiona and data. Produces code com-
patible wiih Ihe S-C Assemliler Iversiuii 4 01. Appte's Toolkit assembler and olher-ii
^35 Disk, Applesoft I32K. ROM or Language CardI
FORM-DS IS a complete system lor the definition ot input anO ouiflut Irom? FORM-
OS supplies tlie automatic checking ol numencinput.rpr acceplatjle ranged values
automatic loi matting of numeric output, and many more features
$25 Disk, ApDle50ltl32K ROM or Language Cerdl
UTIL-DS IS a sel of routines for use wilh Applesoll 10 formal numeric oulpui- selec-
iivfly clear variables lApBlesolfs CLEAR gets evi]iy!h.ngl. improve error handhnB,
and ir.teiface rrrachine language with Applesott programs Includes a special load
routine lor placing macliine language routines underneath Applesoft programs-
S25 Disk. Applesoft
SPEED-DS IS a routine to modify tlie staiemeni linkage in an Applesoll prffyram lo
speed lis B«ecution Improyements ol 5 2D% are common As a bonu^. SPEED-DS
includes machine language routines to speed string handLr
garbage clean up Auttior Lee Meador
515 D.sk, Applesoll (32K. ROM or Language CardJ-
i anil reduce Ihe need for
(Add M-in lor Foreign Mai II
'Apple II IS a registered trademark of the Apple Computer C^.
100
MICRO - The 6502/6809 Journal
No. 40 - September 1981
}
J MCQO
Software Catalog
Wike Rows
34 Chelmsford Street
P.O. Box 6502
Chelmsford, MA 01824
•
t
Name: Enhanced Giaphic
Software foi the Epson
MX-SO and MX-lOO
System; Apple II or Apple 11 +
Memory: 48K
Language; 6502 Assembly
Hardware: Disk drive, Epson MX-80
or MX-lOO printer
Description: Graphic dump which
allows the user to get hard copy
graphics of anything that can be loaded
on the high-resolution pages of the
Apple with one- key stroke commands.
Easy to use, versatile, well supported as
are all graphic dumps from Computer
Station. |The Epson MX-80/MS-100
now added to our line.]
Price; $44.95 includes software,
documentation, practice
pictures /plots
Author: David K, Hudson
Available: Computer Station
11610 Page Service Dr.
St. Louis, MO 63141
(314) 432-7019
Name: Number Cruncher Disk
System: OSI Challenger |C2 and
C3 series)
Memory; 48K
Language; BASIC under OS 65D
Hardware: Disk drive, CRT,
optional printer
Description: A statistical analysis
package, including a data base manage-
ment system with facilities for conven-
ient handling of data series. Contains
commands for producing descriptive
statistics, plus exploratory data
analysis graphics and regression.
Price; $195.00 for 8" disk and
documentation postpaid.
$20.00 for manual only.
Free flier available on
request.
Author: Mike Anderson
Available: Responsive Computer
Technology, Inc.
P.O. Box 719
Silver Spring, Maryland
20901
Name: The Esecutive
Secretary^"
System; Apple H
Memory: 48 K
Language: Applesoft in ROM or
Language System
Hardware: Apple □, one or two disk
drives, lower case
adapter or 80- column
video hoard, shift key
modification, printer
Description: This is the ultimate word
processor for the Apple n computer.
Works with 40- or 80-column screens
interchangeably, shows lower case, has
real shift key. Other features: works at
professional typing speeds; versatile
page numbering and header printing on
each page; file merge and unmerge;
block operations — move, transfer, and
delete; automatic insertion of full
phrases for user-defined abbreviation
(unlimited number); automatic
envelope address; built-in card file
system; interfaces with Data Fac-
tory"'''^, On-Line Database, Information
Master, and Visicalc^" files; file chain-
ing and nesting; "if" and relational
commands to allow conditional print-
ing of information based on the con-
tents of a database; insertion of data
directly from database files (in lower
case, if desired]; permits keyboard in-
put during print time; multi-level
outline indentation; right and left
justified tab stops; dynamic text refor-
matting; immediate mode configura-
tion for display screen, number of disk
drives, and printer (including Cen-
tronics 737 and IBM Selectric]; inter-
faces with CCS clock board for time
stamping of documents; embedded or
external printer commands; character/
word/line insert /replace /delete; selec-
tive or global search and replace; built-
in interface to D.C. Hayes Micro-
modem n"^"; menu-driven operation;
easel-bound, indexed manual; lesson-
type instructions.
Price: $250.00
Available: Aurora Systems, Inc.
2040 E. Washington Ave.
Madison, WI 53704
(608) 249-5875
Name: Business Plus
System: Apple and Atari/800
Memory; 48K
Language: Applesoft & Binary
(Apple)
BASIC & Binary (Atari)
Hardware: Any 80-column printer
Description: An all-in-one billing
system. Handles invoices, statements,
credit memos, purchase orders,
payables, writes checks, account aging
reports (30, 60, 90 and over 90 days),
bar graphs of sales, income and ex-
penses, mailing list with search, sales
register and a whole lot more.
Everything you need for daily business
operations.
Price; $299.00 |or $25,00 for
demo - credited towards
purchase) includes 2
disks and documentation
Author: Advanced Data Systems
Available: Advanced Data Systems
7468 Maple Avenue
St, Louis, MO 63143
Name: Micro- Telegram
System: Apple II or Apple II Plus
Language; Integer BASIC or
Applesoft
Hardware: Apple II or Apple II Plus
Description; Allows Apple owners to
access Western Union Services
worldwide, send and receive TWX''"'^,
Telex"^'^ and international cables, and
send mailgrams. Apple owners can also
access continuously updated reports on
news, stock, foreign exchange, gold,
futures, sports reports and ski condi-
tions through Infomaster® , the
Western Union Data Base,
Price: $250.00 - suggested
retail, FOB Boston,
includes mini-floppy
diskette and
documentation
Author; Microcom, Inc.
Available: Microcom, Inc.
89 State St.
Boston, Massachusetts
02110
No. 40 - Seplember 1981
MICRO - The 6502/6809 Journal
101
Name; Super-Text D
System: Apple 11 word processing
program
Memory: 48K
Language: Assembly
Hardware: Apple 11 or Apple n +
Description: With Super-Text the
basics of text editing are learned quick-
ly, yet its advanced features will meet
the user's expanding word processing
requirements into the future. Add the
Form Letter Module and Address Book
Mailing List for the ultimate in profes-
sional or persona! use word processing.
Price: $150.00 includes
documentation,
an unlimited time
replacement policy, and
dual disk
Author: Ed Zaron
Available: MUSE Software
330 N. Charles
Baltimore, MD 21201
[301) 659-7212
Name: Eureka''"'^ Learning
System
System: Apple C or Apple 11 +
Memory: 32K Cassette,
48K Diskette
Language: Applesoft with some
machine language
Hardware: Cassette or diskette
|DOS 3.3)
Description: An interactive, menu
driven program that helps teachers
create courseware. No programming is
necessary. Any subject may be taught
using symbols and line drawings (Hi-
Res shapes). Courses are presented to
students in three modes, with optional
sound effects. May be used with any
level of student, pre-school through
adult. The material and its style is up
to the teacher, not the computer.
Price: $995.00 for software
license
Author: Eiconics, Inc.
Available: Eiconics, Inc.
200 Cruz Alta
Taos, New Mexico 87571
Name: Sentetice Diagramming
System: Apple II
Memory: 48K
Language: Applesoft
Hardware: Apple 11, Disk II (one or
two drives)
Description: Teaches sentence dia-
gramming, parts of speech, and usage,
for individual student sessions. It is
also an excellent tool for teachers to
use for instruction in one, two, or all of
these areas. Students may use the
teacher-formatted disk for individual
practice at 3 levels of difficulty. Each
level has 20 separate sentences. Op-
tions include creating student record
files, monitoring progress, reading
records, omitting diagramming sec-
tions, etc. This is the best grammar
disk available today. Grades 6-12.
Copies: Many
Price: $19.95 includes disk,
manual, demo sheet
Available: Avant-Garde Creations
P.O. Box 30161 MCC
Eugene, OR 97403
Name: Extended SYM-BASIC
System: SYM-1
Memory: 16K
Language: 5V4K machine language
program
Hardware: Serial terminal and
Synertek BASIC ROMs
Description: Extended SYM-BASIC
adds over 30 new commands /functions
to standard SYM-BASIC. FeatLu:es in-
clude: a unique input line editor;
pagination of program listings; hex
arithmetic and arguments; built-in
printer control; auto line number
prompting; realtime clock; powerful
trace/debug command; trigonometric
patch; ultra renumber; powerful ex-
ecute command; range delete com-
mand; and many others. List of com-
mands follows: $, @HH, @MM, @SS,
APPEND, AUTO, CA, CALL, CR,
CHAIN, DEL, DR, EDIT, EXEC, GET,
GOTO, IN = , LOADP, LOAD NUM,
OUT = , PAGE, PRINTOFF, PRINT-
ON, PRINTUSING, SAVE?, SAVEV,
SAVEB, STIME, TRACE, VERIFY.
Copies: 50 copies (Note: over 200
copies of 8K version
sold.)
Price: $85.00 U.S., $95.00
Canada, includes object
on cassette and 90-pagc
instmction manual
complete with source
listing
Author: John W. Brown
Available: Satum Software Limited
8146 lI6ASt.
Delta, B.C., V4C 5Y9,
Canada
Name: A. 3. Frequency Analysis
System: PET
Memory: 8K
Language: BASIC
Hardware: PET/CBM
Description: Using harmonic analysis
techniques, a frequency scan is made of
a time series, such as stock prices,
which discloses frequencies of signifi-
cant amplitudes. A harmonic analysis
is then made at chosen frequencies. In-
cluded is a logical file input and modifi-
cation to update and delete old data.
Price: $15.00 for cassette and
documentation
Author: Claud E. Cleeton
Available: i22-109th Ave., S,E.
Bellevue, WA 98004
Name: HSD Anova
System: Apple II or Apple II Plus,
DOS 3.2
Memory: 48K
Language: Applesoft
Hardware: Optional printer with
serial or parallel interface
Description: HSD Anova is a powerful,
flexible analysis of variance program
suitable for scientific research and
business analyses. This single program
analyzes balanced designs of from one
to eight independent variables. It can
handle designs composed of between-
subjects and /or within-subjects fac-
tors. Design specification and data
entry are simple. Data entry is from
keyboard or disk, with data editing.
Output is an Anova table on CRT or
printer.
Price: $74.95 includes disk,
complete documentation,
binder.
Author: Stephen Madigan, Ph.D.
Virginia Lawrence, Ph.D.
Available: Human Systems
Dynamics
9249 Reseda Boulevard
Suite 107C
Northridge, California
91324
Name: FORTH-79 Standard
System: Apple n, Apple II -t-
Memory: 48K
Language: Machine Language and
FORTH-79
Hardware: 1-14 disk drives (13 or 16
sector- compatible)
Description: FORTH-79 is a stmctured
language suited for systems and appli-
cations programming with advantages
where execution speed is important
(i.e., data acquisition, process control,
animation, and video games) . Programs
run faster than BASIC and are compact.
The 32-bit integer arithmetic vocabu-
lary is ideal for business applications
and is also extensible. Package includes
screen editor, macro- assembler and
vocabularies for strings, double preci-
sion integers and Lo-Res graphics.
Price: $89.95 includes software
and manual (including
FORTH-79 and Fig-
FORTH)
Author: Martin Tracy and
Philip Wasson
Available: MicroMotion
12077 Wilshtre Blvd. #506
Los Angeles, CA 90025
(213) 821-4340
U
y
102
MICRO - The 6502/6809 Journal
No. 40 - September 1981
i
m
Name: S-FORTH
System: OSI disk systems
Memory: 20-96K
Haitlware; No extra hardware
required
Description: S-FORTH is a full imple-
mentation of fig-PORTH including
editor, a virtual memory disk sub-
system, and compatibility with
OS65D- All OS65D commands are still
usable. You can exit from S-FORTH to
OS65D and then return to S-FORTH, It
is over 10 times faster than BASIC and
is as fast as Pascal. The FORTH com-
piler uses less memory than Pascal and
allows any user with at least 20K to
have an excellent FORTH system.
Price: $34.95 forSM" or 8"
disk (disk and source
listing together are
$49.95)
Author: Digital Systems
Available: Aurora Software
Associates,
P.O. Box 99553
Cleveland, Ohio 44199
Dental Insurance Form
Writer
Apple U with firmware
card or Apple II Plus
48K RAM
Applesoft, DOS 3,2, 3.3
Disk drive, 80- column
%
Name:
System:
Memory:
Language:
Hardware:
printer
Description: You can prepare Universal
American Dental Association Insur-
ance Claim forms on your Apple. Each
form can be prepared, saved to disk,
reloaded, edited and printed as many
times as you desire. Dental Insmance
Form Writer allows rapid billing and
claim submittal with a minimum of ef-
fort. A master form can be created for
each family/ patient and saved for later
■use. This master can be loaded, treat-
ments entered, printed and sent as a
pre- authorization or actual statement.
Over 100 families per diskette.
Price: $100 includes manual
Author: J. McFarland
Available; Andent Inc.
1000 North Ave-
Waukegan, Illinois 60085
Name; Pulsar D
System; Apple II or Apple II Plus
Memory: 48K
Language: Machine
Hardware: One disk drive. 13 or 16
sector controller card
Description: Two games — Pulsar II
and Wormwall in a unique combina-
tion. Each game has eight levels of play
and score can be transferred between
the two. The object of Pulsar n is to
destroy the spinning shields around the
Pulsar and destroy it. Wormwall places
you in one of the strangest mazes ever
created. The walls do not connect and
openings occur only temporarily as col-
lored lines cross. Little creatures chase
you in each part of the maze.
Price: $29.95 includes disk and
documentation.
Author: NASIR — Presented by
Sirius Software, Inc.
Available: Your local Apple dealer
or software store.
Name: The Dragon's Eye
System; PET or Apple
Memory: 32K (PETI and 48K
(Apple)
Language; PET BASIC, Applesoft
BASIC
Hardware: PET, Apple H
Description: An overland fantasy game,
where the player has 21 game days
(approximately a half an hour playing
■ time), to find the Dragon's Eye, a
magical jewel hidden by an evil magi-
cian. The player chooses one of 16
characters, and gains a set of magical
abilities. He also chooses among 13
commands. When he combats the
vicious monsters, animated graphics
display the action between player and
beast.
Price: $24,95
Author: Automated Simulations,
Inc.
Available: Automated Simulations,
Inc.
P.O. Box 4247
Mountain View,
California 94040
Author;
Available:
Mark Tuimell
Your local computer
software store
Name: Sneakers
System: Apple II or Apple II -t-
Memory; 48K
Language; Machine
Hardware: Disk Drive
Description: Sneakers are little guys
who appear to be friendly but will
quickly stomp you out if you do not get
them first. After the Sneakers come
wave after wave of Cyclops, Saucers,
Fangs, H-Wings, Meteors, Scrambles
and Scrubs. The variety is incredible
and the challenge unending. Sneakers
is playable with keyboard or paddles.
Price: $29.95 includes disk,
documentation and a
T-shirt transfer
Name:
System;
Memory:
Language:
Hardware:
Olympic Decathlon
CP/MorTRS-80
48K for Apple II or II + ;
32K for disk drive
TRS-80 Model 1; 16K for
cassette TRS-80 Model 1 .
Machine
Apple Dor II + ; TRS-80
Model 1, disk or cassette
Description: Enjoy the excitement and
skill of Olympic competition with this
game which takes you through all 10
events of the real Decathlon. Each
event is presented with animated
graphics that put you into the action.
Eight and six players can compete
respectively with the TRS-80 and Apple
versions. Repeat feature lets you prac-
tice any event as many times as you
wish prior to beginning the actual com-
petition. Yoiu" best times can be com-
pared to actual recorded Olympic
Decathlon times.
Price; $29,95 includes
instruction manual and
5W" disk (cassette for
TRS-80 cassette veision|
Author; Tim Smith
Available: Microsoft Consumer
Products
400-108thAve, NE
Suite 200
Bellevue, WA 98004
Name: Cavern of the Dwarves
System: SYM with BAS-! or KIM
8K BASIC at 2000 H
Memory: 16K
Language: BASIC
Hardware: Terminal using standard
serial I/O ports on SYM
or KIM
Description: An adventure game in
which you wander a large cavern seek-
ing treasure, fighting monsters, and
trying to avoid getting killed by the
many dwarves who inhabit the cavern.
You communicate with the computer
using one- and two-word commands.
Price: $10,00 on cassette tape,
ppd, in U.S. only
Author: Lee Chape!
Available; Lee Associates
2349 Wiggins Ave,
Springfield, IL 62704
No, 40 -September 1981
MICRO - The 6502/6809 Journal
103
Hot pursuit
through space
and the
vortices
of time!
PRESENTS.
Siin« toffd
The fallen Time Lord, who presumptuously calls himself The Master, Is at large.
The elders of Waldrom have supplied you with the hyperspace-worthy vessel
Tardus, and commissioned you to eliminate the evil "Master". Your resources
Include clones who will fight for you, the formidable CRASER weapons of the Tardus,
and magic weapons such as Fusion Grenades and Borelian Matrix Crystals.
Traveling through hyperspace in search of the evil one, you will encounter Time
Eaters, Neutron Storms, and other alien creatures and phenomena. Entering real
space to search planets, you will encounter still other dangers. You will enter native
settlements to buy food and supplies — or to fight for survival.
And once you find The Master can you destroy him?
Based on Dr. Who of PBS fame.
Apple Integer Basic,
Disl^, 48K . . . $29.95
.
TS€:HPiTO6ID€
e SouTIl Si MlMorO. fJH 03055 (603)673.5140
TOLL FREE OUT.OF.STATE 1800-158 1790
%
104
MICRO - The 6502/6809 Journal
No. 40 - September 1981
bask:
TSE-HARDSIDE HAS IT ALL
IN ONE!
How many times have you wished that there was a single source for *■
your personal computer needs? Well look no further, TSE-
HARDSIDE, located in pleasant New Hampshire, has virtually every
conceivable item (or your micro. Whether you're shopping for your
Apple, Pet, TRS-aO'" or Atari, TSE-HARDSIDE has it all. We stock
hardware, software, books, magazines and specialty items for all of
the popular machines. So the next time you're out shopping for your
system don't be surprised, be satisfied. Remember the name TSE-
HARDSIDE as your choice for quality, service and reliability.
TSCiUPIRDSIDC
6 South SI UilPnra NH 030S^ (6031673-5144
TOLL FREE OUT.QF-ST ATE 1 ■800158.1790
\
i
No. 40 - September 1981
MICRO - The 6502/6809 Journal
105
MICRO
Dr. William R. Dial
438 Roslyn Avenue
Akron, Ohio 44320
^
6502 Bibliography: Part XXXVI
1045. Interface Age 6, Issue 2 (February, 1981)
Lane, Eric T., "Microcomputing— At the Speed of Light, ' '
pg. 75-76, 136.
Graphics show what an obiect looks like at the speed of
light, for the Apple.
Stotts, Gary A., "Amortization Schedule," pg. 90-91.
The Apple program to show you where your money
goes when you are paying off a loan.
Schlarb, Keith N., "Information Source for Home and
School," pg. 94-95, 138-140,
A random access file program lor the Apple,
1046. Apple Cookbook 1, Issues 5/6 (February, 1981)
Maly, Frank, "Proper Program Design," pg. 1-2.
A tutorial on writing proper programs with the Apple,
Golding, Val J,, "Applesoft from Bottom to Top,"
pg, 3-6,
A roadmap to Applesoft to help you understand
programming,
Reynolds, Lee, "EXEC Files on the Apple E," pg. 6-7.
A short instructional article on the EXEC command.
Rivers, |erry, "Sorting," pg. 7-10,
A discussion, with examples, of the various types of
sorting routines.
Simpson, Rick, "Introduction to Assembly Language,"
pg, 10-13-
A tutorial on assembly and machine language for the
Apple,
Tyro, A,, "Pascal: Beginners Notes," pg, 13-14,
A Tab Demo program in Pascal,
Anon,, "Apple Doodle," pg. !5,
An assortment of short routines and procedures for the
Apple,
1047. 73 Magazine No. 245 (February, 1981)
Erdei, Steven G,, "Under Software Control,"
pg, 94-98,
A repeater control system with minimal hardware,
using aKIM-1,
1048. Byte 6, No. 2 (February, 1981)
Zimmermann, Mark, "A Beginner's Guide to Spectral
Analysis," pg, 68-90,
An instructional article including listings for the PET,
Woteki, Thomas H,, "A Pascal Library Unit for the
Micromodem U," pg, 106-136,
Programs for the Micromodem on an Apple/Pascal
system,
1049. L.A.U.G.H.S. 3, No. 1 (January, 1981)
Connelly, Pat, "A Disassembler for S-C Assembler,"
pg, 3-8.
A disassembler which dissembles into source code for-
mat is a definite asset to augment your S-C Assembler,
for Apple,
1050. Southeastern Software Newsletter Issue 24
(February, 1981)
George McClelland, "Software Reviews," pg, 1-6,
A review of new games for the Apple,
1051. Dr. Dobb's Journal 6, No. 52, Issue 2 (February, 1981)
Caulkins, Dave and Harris, David C, "PAN — One
Activity of the PCNET Project," pg, 17, 37,
Discussion and updates for PAN, a communication net
implemented on the PET.
Gordon, H,T,, "Byte-Count Routine," pg, 37.
Modifications to CNTBYT and BYTNUM routines for
6502 micros,
1052. The Transactor 2, No. 12 (ca. February, 1981)
Anon,, "Exclusive OR on Your PET," pg. 2.
Add this useful function to the PET.
Anon., "Bits and Pieces," pg. 2-5.
Miscellaneous PET notes including discussion of
logical operators; differences among BASIC 1.0, 2.0,
and 4.0; screen loadingi NEC Spinwriter; Card Print
Utihty, etc.
Hooks, Dave, "Card Print Utility," pg. 6-7.
Listing and cross references for the PET,
Hoogstraat, J., "PET BASIC Label Support Interface,"
pg. 8-13-
An interesting PET routine residing in the second
cassette buffer allowing the use of labels in BASIC. For
BASIC 2,0.
Anon, "BASIC 4.0, DOS 2.0 and the Relative Record
System," pg. 14-21.
The new PET operating systems, discussion and
tutorial with examples.
Higginbottom, Paul, "BASIC 2.0 to BASIC 4.0 Conver-
sions (40 Column)," pg. 22-31.
.All about converting several types of PET BASIC pro-
grams- With memory map, entry points, 6502 op codes,
status variables, etc.
Troup, Henry, "The PET NMI Vector," pg, 32-33.
An instructional article on the non-maskable interrupt.
Butterfield, Jim, "A Few Entry Points, 1,0/2.0/4-0
ROM," pg- 34-35.
A useful tabulation for PET users.
Troup, Henry, "Fun with WAIT Statements," pg. 36-37.
All about PET Wait command.
Anon., "8032 Control Characters," pg. 38-40.
Discussion and tabular summary of control functions.
1053. T.A.R.T. 2, Issue 1 |February, 1981)
Smith, Eric, "String Art," pg- 3-5-
A graphics program for the Apple,
Sander-Cederlof, Bob and Koerin, Sid, "Hi-Res Crest
Design," pg. 6-8-
A graphics program for the Apple,
106
MICRO - The 6502/6809 Jourrta!
No, 40 -September 1981
i
Shipley, Jim, "Revision 7 and 7a Motherboards,"
pg. 12-13.
A description of the latest Apple motherboards and
instructions for hardware modifications.
1054. MICRO No. 33 (February, 1981)
Guest, Ronald A., "A Simple Securities Manager for the
Apple," pg. 7-13.
An Apple program to manage your stocks.
Elm, Robert L. ,"Why WAIT?", pg. 15-16.
Interesting applications of the WAIT function on the
OSI and PET systems.
Colsher, William L,, "An Atari Assembier," pg- 17-19-
A simple one-pass assembler for the Atari.
Cheng, Thomas, "Tuming USR|X| Routines into BASIC
DATA Statements," pg, 21-22.
A program for the OSI CIP to save machine language
routines as BASIC DATA statements.
Wells, George, "Improved Dual Tape Drive for SYM
BASIC," pg. 23-28.
Utility routines for SYM to enhance the use of two
cassettes, including a tape duplication feature.
Bongers, C, "In the Heart of Applesoft," pg, 31-47.
A tutorial on how to work with Applesoft.
KoUar, Larry, "One Dimensional Life on the AIM 65,"
pg, 50-52,
A Life game taking advantage of the AIM's 20-character
display.
Tenny, Ralph, "Increase KIM-I Versatility at Low Cost,"
pg, 57-59.
A hardware article for the KIM involving moving the
primary address decoder off-board, making it possible
to add other I/O devices.
Strasma, fames, "PET String Flip," pg. 65-66.
A solution to the problem of upper and lower case in-
version using CBM 2022 and 2023 prmters with Old
ROM PETs.
Wright, Loren, "PET Vet," pg, 68.
A modified routine to allow you to recover from a crash
without losing memory; how to avoid accidental
INPUT exit, etc.
Ell, David A., "A CIP Sound Idea," pg. 71-72.
A hardware addition creating a belltone for the CIP or
Superb oard il.
Sebra, Randy, "Does Anybody Really Know What Time It
Is?",pg- 75-79.
Hardware and software for using the OKI Semiconduc-
tor MSM5832 CMOS clock chip on your 6502 system,
with a BASIC listing for the SYM.
1055. Atari Computer Enthusiasts 2, Issue 2 (February, 19S]|
Smith, Wynn, "More on BASIC."
How to get more speed from your BASIC programs on
the Atari.
Crawford, Chris, "Missile- Graphics Demo."
A BASIC listing for an Atari graphics routine.
Anon., "POKE Text Into Graphics 8!", pg. 7.
How to POKE alphanumeric graphics characters into
the Atari graphics 8 mode.
1056. The Apple Peel 3, No. 2 (February, 1981)
Jenkins, [erry, "Apple Program Conventions," pg. 6.
A routine to add credits, etc. to program listings for
Apple software donated to a club library.
Brown, Thomas A., "Telephone Dialer," pg. 9-10.
Hardware and software listing for an Apple telephone
dialer.
1057. Creative Computing 7, No. 2 (Febniary, 1981)
Piele, Donald T., "How to Solve It — With the
Computer," pg. 82-92.
A group of programs including Applesoft conversions.
Chapel, Lee, "Monster Combat," pg. 106-116.
A game written in BASIC for the KIM.
Stith, John E., "Lower-Case Display for Apple Writer,"
pg. 124-129, (Continued on next page)
EDIT 6502
r.M. LJK
Pass Assembler, Disassembler, and Editor Single Load Program
DOS 3.3.. 40/80 Columns, for Apple II or Apple 11 Plus*
A MUST FOR THE MACHINE LANGUAGE PROGRAMMER. Edit 6502" is a two pass Assem-
bler, Disassembler and text editor lor tlie Apple computer. It is a single toad program
that only occupies 7K of memory. ¥ou can movefreely between assembling and disas-
sembling Editing is hotli ct5aracler and line orientaled. the two pass disassemblies
create editable source files. The program is so written so as to encompass combined
disassemblies o(6502 Code, ASCII text, hex data and Sweet 16 code Edit 6502 makes the
user feel he has neuer left the environment of basic. It encompasses a large number of
pseudo opcodes, allows linked assemblies, software slacking (single and multiple
page) and complete control of printer (paganation and lab setting)- User is free to
move source object and symbol table anywhere in memory. Requirements; 48K o1
RAM, and ONE DISK ORiVE. Optional use o1 BOcolumn MSR board, or lowercase availa-
ble with Paymar Lower Case Generator.
TAKE X LDDK K JUST SOME DF THE EHITINS COMMKNIl FEATiniEE. Inserl al line On Delele acharacter
Insen a characLef Delele a line C n List line » nl, n21ij line fl nS Cliange line KnI lo nZ 'sliingl'Seaicti
line * nl lo n2 "stringi"
LJK EntBipriaSB Inc. P.O. Box 10827 St. Louis, MO 63129 (314)84ftfl1Z4
•EdH S&K I.M. ot LJK tnl. Inc.. - 'Amilt IM. d) Appit Compuler Inc.
LOa*; At THESE KEY BOARD FUHCTIONS: Copy (oltieenOolliiiB anil
e^ii Go Fq llie t>eginning o1 \he line aborl operaTior delete a
cnaracler al cursor (Qcaiion go lo end ol line (ind characler
aller cursor location, nan desliuctive baolispace insert a
cliaractei al cursor location shifl Incli shiil release (or*aid
copy delele line n umber pietii special prin I char acleis Com-
plele cursor conlrol home and clear. riQhl.lelMoAnup Scrolla
fine al a lime Nivr lypi i lint nunlw igiin.
All Ihl* ind much mucli mofs ~ Stiid lot FREE Infurmitlon.
Introductoiy Price $50.00.
No. 40 - September 1981
M ICRO - The 6502/6609 Journal
107
A modification for the Applewriter software.
Yob, Gregory, "Personal Electronic Transactions,"
pg- 154-160.
Discussion of the PET Toolkit, BASIC 4.0, and PILOT
language.
Blank, George, "Outpost: Atari," pg. 168-171.
Discussion of Atari graphics, listing for Decimal
Dump, the PEEK function, etc.
Carpenter, Chuck, "Apple-Cart," pg. 172-180.
Discussion of programming languages for the Apple, in-
cluding Mini PILOT; Mini-PILOT Interpreter, etc.
1058. KB Microcomputing No. 50 jFebmary, 1981)
Baker, Robert W-, "Tape-To-Disk Data File Copy,"
pg. 15,
A basic program for the PET.
Chamberlin, Hal, "Simulation of Musical Instruments,"
pg. 142-148,
Part 2 of this series on music synthesis includes
routines written for the KIM.
Kammer, David W., "Autoloader Program for the CIP
and Superboard II," pg. 158-160,
Routines to load and save machine language programs
on OSI systems.
1059. Personal Computing 5, No. 2 (February, 1981)
Miles, Kenneth, "Menu- Writer," pg. 38-42,
Let Apple write a menu for your Applesoft or Integer
BASIC programs,
Kaiis, Robert, "Archimedes' Spiral," pg, 81-82,
A versatile graphics Hi-Res program for the Apple.
1060. CSRA Computer Club Newsletter (Febraary, 1981)
Morse, Ken, "Permanent (?| Comment," pg, 1.
A program to convert Integer BASIC line numbers to
65535 to make them more resistant to imdesired deletion,
Sikes, Randy, "DOS 3,3 Update," pg- 4.
A simple fix for the new Apple DOS 3.3.
1061. Softalk 1, No. 6 (February, 1981)
Wagner, Roger, "Assembly Lines," pg. 26-29.
Part 5 of the guide to assembly language covers branch
instructions.
1062. O.S.I. Users Independent Newsletter No. 8
(February, 1981)
Curley, Charles, "Implementing the NEC Spinwriter,"
pg- 1-8,
Some notes for OSI owners who wish to use the
Spinwriter.
1063. Poke Apple 3, No. 1 (February, 1981)
Averill, Bonnie Kaufman, "Elementary Programming; A
Basic Budget," pg. 11-13,
The first of a series of tutorial articles showing how to
develop a budgeting program.
Neff, Thomas M., "Apple Notes," pg. 14-15-
Discussion of the use of Apple's Editor /Assembler,
found in the DOS Toolkit, Also Neil Konzen's Program
Line Editor and the INIT command,
Garvey, Michael, "Storing and Reading an Array on
Disk/' pg, 16-17,
A utility for the Apple,
Greene, Amos, "Sex and the Single Drive (Disk
Version)," pg, 18-19,
;tioiial article on the storage of data on the
An instruc.
Apple Disk
1064. Apple-Dayton 2, No. 2 (February. 1981)
Anon., "Program List Formatter," pg, 2,
An EXEC File Operator for the Program List Formatter
in the Winter Orchard magazine,
1065. The Michigan Apple-Gram 3, No. 2 (February, 1981)
Tuttleman, Roger, "Languages, Languages," pg, 1-4,
An Apple/Pascal program to plot circles, etc, on the
Hi-Res screen,
Tuttleman, Roger, "Getting Started in Pascal," pg, 6-7,
An instructional article with a BASIC Booter Routine in
Apple /Pascal.
Rivers, jerry, "Principally Pascal," pg. 11-14,
PRINTIT, a program for Apple/Pascal designed to send
all or part of a ,TEXT file to either the console or to your
printer,
Deegan, W, Curt, "Hiding Amidst the DOS with
PUMA," pg- 16-18,
Protected user memory area for your Apple-
Anon-, "lAC Apnote: The Apple H Cassette Interface,"
pg, 19-21,
A description of the stracture and operation of the
cassette interface.
Anon,, "lAC Apnote; The Preliminary Apple Pascal
Guide to Interface Foreign Hardware," pg, 26-41-
A detailed guide to interfacing in Apple Pascal systems,
Sokal, Dan, "Pascal— PEEKs and POKEs," pg. 42-43.
A program for the Apple/Pascal library.
Anon,, "lAC Apnote: Text Screen Mapping and Use,"
pg, 43-44-
A good source of information on how to POKE
characters on the Hi-Res screen.
1066. The Seed 3, No. 2 (February, 1981)
Anon,, "Apple PI Conventions," pg- 4,
A program to enter standard program labels into soft-
ware items donated to club libraries, for the Apple.
Breyfogle, Louis D. and Quinn, jack D,, "The 13/16 Sec-
tor Problem: A Solution," pg, 8-9,
Stadfeld, Paul, "Space Exploration," pg, 11.
An instmctional article on using Applesoft's SPC
function,
1067. Compute! 3, No. 2, Issue 9 (Febraary, 1981)
Lee, Amie, "LED — A Line-Oriented Text Editor,"
pg- 16-20,
A utility for the PET to maintain PASCAL source
language statements.
Baker, Robert W,, "The Atari 825 Printer," pg, 24-28,
Description and evaluation of a printer for the Atari
systems,
Butterficld, fim, "Simulated PRINT USING," pg, 30-32,
A program for 6502 micros.
Albrecht, Bob and Firedrake, George, ' The Mysterious
and Unpredictable RND," pg. 34-40.
Part 2 of several articles on the RND function, PET
oriented.
Wachtel, A., "Stat Lab," pg- 42.
A statistical program for 6502 systems.
Dejong, Marvin L., "A BCD to Floating-Point Binary
Routine," pg. 46-52.
^
T08
MICRO - The 6502/6809 Journal
No. 40 -September 1981
A routine for the AIM 65 micro.
Lowell, f.R,, "BASIC Math for Fun and Profit,"
pg. 54-59.
An 8K elementary arithmetic program written for the
16K PET with new ROMs.
Esbensen, Tory, "PET Spelling Lessons Your Students
Can Prepare," pg. 60-62.
A program for the PET.
Falkner, Keith, "List Apple Integer BASIC Programs One
Page At A Time," pg. 64-66-
A machine language utility for the Apple to assist in
listing Integer programs.
Gat, Erann, "The 25C Apple H Real Time Clock,"
pg. 68-73.
An article on inexpensive hardware and software for an
accurate clock for the Apple.
Martell, Eric and Murdock, Chris, "Ticker Tape Atari
Messages," pg. 74.
A horizontal scrolling message routine for the Atari.
Schreibman, Arthur, "Atari Colors and Sounds with Pad-
dles," pg. 75.
A short program for the Atari.
Veludo, Hemique, "Atari Terminal," pg. 75.
A short communications program allowing contact
over the telephone with a remote computer system.
Braannon, Charles, "Character Generation on the Atari,"
pg. 76-78.
A tutorial on defining the character set of the Atari.
Kingston, C, "Put a Printer on the Atari Ports,"
pg. 82-85.
Drive a printer through the joystick ports.
Boden, Gary, "Double-Density Graphing On the OSI
CIP," pg. 86-87.
A way to effectively increase the normal 24 x 24 format
of the CIP to a 40 X 40 format for graphing functions.
Berger, Tom R., "A Small Operating System: OS65D —
The Kernel," pg. 88-94.
Part 2 of 3 with subroutine descriptions for OSI
systems.
Reid, Neal E., "Contour Plotting," pg. 97-102.
How to produce graphs of functions of two variables
using the PET and a 2023 friction feed printer.
Young, R.D., "Relocate," pg- 103,
Relocating or loading programs to portions of memory
other than from the normal beginning of memory.
Butterfield, Jim, "Mixing and Matching Commodore
Disk Systems," pg. 104-108.
A discussion and notes on PET/CBM disk systems.
Spencer, Peter, "Memory Calendar," pg, 109-113.
A program for the PET.
Deal, Elizabeth, "Crash Prevention for the PET, ' '
pg- 114-116.
Several reasons for crashes and how to avoid them.
Butterfield, Jim, "Odds and Ends," pg. 118-119.
Notes on PET/CBM files.
Garst, lohn F., "Three PET Tricks," pg. 120.
On-line REMarks; flashing cursor for GET; and pretty
printing.
Bruey, A.(., "Pascal on the PET," pg. 124-125.
A discussion of this additional language for the PET.
Land, Bruce, "A Terminal tor 'KAOS' (KIM, AIM, OSI,
SYMI," pg. 128-133.
Hardware for small single board micros to make a sim-
ple communications terminal.
MacKay, A.M., "SYMple Clock," pg, 134-137.
A clock program that is a little different — for the 4K
SYM-1.
Chamberlin, Hal, "Expanding KIM-Style 6502 Single
Board Computers, pg. 138-139.
How many expansion boards can the unbuffered
microprocessor bus drive before becoming overloaded?
Wells, George, "Load and Save KIM BASIC Programs on
YourSYM," pg. 140-142.
Can cousins marry and remain happy?
1068. Apple-Com-Post Issue 9 (ca. fune, 1980)
Knuelle, Alfred, "Paddles, Joysticks undsoweiter," pg. 8.
How to use a 40K pot in place of a difficult-to-find 150K
pot in constructing paddles or joysticks for the Apple.
Kniefel, J. and Goetze, Uwe, "Programmschutz,"
pg. 11-12.
How to add copyright statements to your basic pro-
(Coatiaued on next page)
The only
thing you can
do with a
balled Apple
is eat it.
-Apple II is a trademark of Apple computer, Inc.
The more you stuff your Apple il'" with plug-in
boards, the more of a chance it has to overheat.
And once that happens, it won't do anybody any
good. Your program bombs and you start losing
dme and money.
The solution? Simple. Take two minutes to install
the Dana Industries fan in the back of your Apple,
and you'll practically never have to
worry about overheating again.
So pick up the Dana industries
fan at your local
computer store.
And your Apple
will have a long and
fruitful life.
No. 40 - September 1981
MICHO -The 6502/6809 Journal
109
grams and make them more resist'ant to obliteration or
alteration.
1069. From The Core (February, 1981)
Whittaker, Alec, "Lazer Lower Case Plus," pg. 4.
A review of new hardware for the Apple. Also some
routines for text files.
Schroyer, feff, "Lazer Lowercase in Depth," pg. 5.
An evaluation of this new hardware mod in some detail.
Anon., "Dr. Apple: Some Uses for a Disassembler,"
pg. 5-7.
Use the disassembler to assist in Pascal/ Apple programs.
Lingwood, David A., "Overlaying in Applesoft," pg. 6-7.
How to get a 20K program to run in 8K.
Budge, Joe, "The Locksmith," pg, 3.
Some notes on the use, ethics, etc. of this utility m
'unlocking' protected software disks.
1070. Mini'app'lcs 4, No. 2 (February, 1981)
Pinotti, Terry L-, "DOS 3.2 and 3-3 on Single
Controller," pg. 2-3.
Hardware modification to your Apple Disk II controller
card to switch back and forth between the 13/16 sectors.
Hammond, Daryl, "Pondering Pascal: RunTime Errors,"
pg. 11-15.
A tutorial on Apple/Pascal and an example of how to
debug Pascal programs.
Pinotti, Terry L., "Came Paddle Port Modification," pg. 15.
A simple hardware mod to make installing accessories
on the Apple I/O ports.
1071. Spreadsheet (Visigroup — A Visicalc User Group) 1,
No. 1 [November, 1980)
Staff, "Definitions," pg. 2.
Definitions to make coimnunications amongst Visicalc/
6502 users easier.
Staff, "Template," pg, 3.
Typical layout for a Visicalc sheet, reserving the first
two columns for variables.
1072. Spreadsheet 1, No. 2 (January, 1981)
Mellon, Arthur Mellon, "Merging Templates," pg. 2.
A time-saving procedure for setting up sheets.
Anon., "Visilist," pg. 5-6.
An accessory utility for printing out the contents of
Visicalc template formulas, valuable in diagnostics and
planning improvements.
Ender, Philip, "Visitip #5: Flashing M."
How to avoid that flashing M by using more memory in
your Apple.
Staff, "Visitip #6: Template Development Aid,"
pg, 6,
How to find out where the "to" print position has got
to in a template under development.
1073. Printout 2, No. 2 (February /March, 1981)
Batey, Duncan, "Matrix Codes," pg, 11.
Useful table for PET users,
Valentine, Mark, "Tick Tock PET," pg. 11,
A 12-hour clock ma chine- language routine for PET,
Nuttall, lohn, "Visicalc: How and Why," pg, 18-19.
All about Visicalc for the PET,
Tumbull, Tommy, "Tommy's Tips," pg. 21, 47,
Automatic deletion of DATA statements; instant
algebraic input; etc.
Anon., "Turnkey ROMs: Do they Open the Door?",
pg, 22, 31.
How to implement turnkey operation on the PET,
Jarrett, Dennis, "PET Communications — State of the
Art Report," pg. 24-29,
A special in-depth presentation on PET commimication
hardware, systems, etc.
Staff, "Colour Display Arrives for PET," pg, 33-35.
A review of the Chromadaptor for the PET system,
Sanders, Gavin, "Get Back in the Black," pg, 36-37,
How to recover and make reuseable those old printer
ribbons.
Yob, Gregory, "Personal Electronic Transactions,"
pg, 43-45.
How to get lower case on the PET; a program for POKE-
ing machine language into the PET memory; and
several short machine language routines for the PET.
1074. FWAUG Newsletter 2, No. 2 (December, 1980)
McVay, Ray, "Disk Status Finder," pg, 2-10.
A machine language routine that can be run from either
DOS 3.2/3.3 which will tell the current DOS version,
Master/slave status, free sectors and auto-boot file
name,
Meador, Lee, "Disassembly of DOS 3,2 — Part 10,"
pg. 12-18,
This section of DOS is nearly identical between 3,2,
3.2,1, and 3,3 — devoted to the DOS command
decoder.
1075. Apple Assembly Line 1, Issue 5 (February, 1981)
Sandcr-Cederlof, Bob, ' 'Apple Noises and Other Sounds, "
pg- i-9.
Routines for Apple bell, machine-gun noise, laser
swoop, inch-worm sounds, touch-tone simulator,
morse code output, etc,
Boering, Brooke W,, "Faster 16x16 Multiply,"
pg, 11-12-
A routine for rapid multiplication of two 16-bit values
to get a 32-bit value,
Sander-Cederlof, Bob, "A String Swapper for Applesoft,"
pg, 14-15,
Rearrange data, sort alphanumeric s, all the easy way.
1076. Softside 3, No. 5 (February, 1981)
Pelczarski, Mark, "Developing Data Base: Part 6,"
pg, 16-17, 82-83,
This month capabilities for print formatting are added
to this utility for Apples and Ataris,
Truckenbrod, Joan, "Three Dimensional Rotation — Part
III," pg, 22-25,
An Apple Hi-Res graphics program,
Schoenmeyer, Roger, Thompson, Robert and Mueller,
Carl, "Apple One-Liners," pg. 45,
Three oneline programs for the Apple.
Case, Phillip, "Miner," pg, 48-52.
Atari and Apple versions of a program offering adven-
ture deep in an abandoned gold mine.
Cross, Mark, "Famous Sayings Hangman," pg, 59-61.
A different type of Apple Hangman,
Ockers, Stan, "Changing Hearts," pg. 64-65.
An Atari graphics program,
Daoust, John, "Darts," pg. 84.
A paddle game for the Apple.
MCftO
I.
^
no
MtCHO - The 6502/6809 Journal
No. 40 - September 1981
II
A
Wooden
Computer?
Not from Commodore!
So why should the desk look like wood? A pleasant
cream and charcoal Irimmed desk looks so much better
with Commodore systems. One look and you'll see.
Interlink desks are right. By design.
The specifications only confirm the obvious:
•Cream and charcoal
color beautifully matches
the Commodore hardware
and blends with your
decor.
•An ideal 710 mm (28"}
keyboard height yet no
bumping knees because a
clever cutout recesses the
computer into the desk-
top,
•High pressure laminate
on both sides of a solid
core for lasting beauty
and strength,
• Electrostatically applied
baked enamel finish on
welded steel legs— no
cheap lacquer job here.
•T-molding and rounded
corners make a handsome
finish on a durable edge
that won't chip.
• Knocked down tor safe,
inexpensive shipment.
• Patented slip joints for
quick easy assembly.
• Leveling glides for
uneven floors.
•Room enough for a
Commodore printer on the
desk, yet fits into nearly
any den or office niche—
H: 660 mm (26") W: 1170
mm (46") D; 660 mm (26"|.
• Matching printer stand
available with slot for
bottom feeding.
PRICE: $299
In short, as Commodore dealers, we won't settle for
anything that looks good only in the catalog! Our
customers won't let us. They don't buy pictures. And
neither should you. This is why we will let you use oneof
our desks for a week and then decide. If for any reason
you don't like it, just return it in good condition for a
cheerful refund.
Advertisers' Index
If your Commodore dealer doesn't carry our desks yet,
send a check (or $299 and we will ship your desk freight
paid!
Name
Address
City
_St_
_Zlp_
Interlink, Inc., Box 134, Berrien Springs, Ml 49103
Master Charge and Visa welcome. Call our order line:
61S-473'3103
Aardvark Technical Services 86
Abacus Software 96, 100
Advanced Operating Systems BC
Anaheim Computer 89
Andromeda, Inc 48
Applied Analytics, Inc 42
Avant-Garde Creations 98
Beta Computer Devices 43
Broderbund Software 31
Central Point Software 7
Classified Ads 91
Cleveland Consumer Computers 82
Columbus Instruments 43
CompuTech 92
Computer Case Go 35
Computer Maif Order 34
Computer Station 89
Co-op Software 61
Connecticut Information Systems, Co 92
Consumer Computers 26
Creative Computing 95
Decision Systems 100
Dtack Grounded 35
D&N Microproducts Inc 90
Dosware Inc 73
Eastern House Software 35
Enclosures Group 90
Exatron is
Execom Corp 32
Fessenden Computer Service 100
Galfo Systems 96
Gimix, Inc 22
Hogg Laboratories 96
Howard Software 78
Hudson Digital Electronics 36
Huntington Computing 6
Instant Software 24-25
interlink, Inc m
Jini Micro Systems 44
Lazer Systems 65
LJK Enterprises 107
Logical Software, Inc 74
Maramoty & Scotto Software Corp 19
Micro Co-op 40
Micro Distributors 109
MICRO INK. Inc 77
Micro Interfaces 12
Microsoft Consumer Products IPC
MicroSoftware Systems 67
Micro-Ware Distributing Inc 74
Mittendorf Engineering 14
Modular Systems. 13
Mountain Computer ibc
National Computer Shows 1
Nikrom Technical Products 67
Omega Microware 81
Omega Software Products 47
Pegasys Systems 74
Perry Peripherals 13
Progressive Computing 13
Quality Software 70
Real-Soft 99
Rosen Grandon Associates 67
Sensible Software 57
Serendipity Systems, Inc 96
Sirius Software 2
Skyles Electric Works 17, 31, 46. 91
Small Business Computer Systems 67
Smartware 92
Smoke Signal Broadcasting 23
Softape 56
Stellation Two 47
Sunset Electronics 40
Synergetic Solutions 89
Synergistic Software 81
Synertek Systems 4
Technical Products 100
Terrapin, Inc 7
Travenol Laboratories Inc 90
TSE Hardside 104-105
Unique Data Systems 41
Versa Computing 58
No. 40 - September 1981
MICRO - The 6502/6809 Journal
111
Next Month in MICRO
In addition to the usual, balanced coverage we strive for in MICRO, since June 1981 we
have added pages devoted to special topics. We call these added pages BONUS sections.
Commodore Bonus Section
This section will include the following articles:
• VIC Light Pen-manship — evaluates
several manufacturers' light pens which can
be used with the VIC and offers
demonstration programs for applying the
pens as a scribe or color paint brush.
• The PET from A to D — Analog to digital
conversion on the PET.
• Speeding Up ASCII File Retrieval —
Machine language techniques to speed file
retrieval in the PET and Apple.
• Commodore ROM Genealogy — An up-to-
date list of all the combinations of
Commodore's ROMs, keyboards, and screens.
> Character Set Substitution — Explains
how PET characters are generated and
discusses several alternate character sets
that can be substituted for the largely
redundant second character set.
Apple Bonus Section
Apple users will continue to receive extra
material in October in the Apple Bonus
Section. A sampling of articles follows,
A Booby Trap in Applesoft addresses
"protection" schemes for Applesoft. Random
Numbers Generator in Machine Language
offers a simple subroutine to use in a machine
language program whenever random numbers
are needed. And Taming tine Wiid Reset tells
how a user can easily modify an Apple key-
board to ignore normal resets. Solar Simulation
provides a program for printing information and
plotting positions (using hi-res graphics) of the
first six planets of the Solar System.
Coming in November
November brings a double BONUS featuring
Games and still more on the Apple — just in
time for the upcoming, gift-giving holiday
month of December.
40% OFF
Your money goes farther when you sub-
scribe. During the course of a year, when you
subscribe, you save 40% (in the U.S.).
Pay only $18.00 ($1-50 a copy) for 12 monthly
issues of MICRO sent directly to your home or
office in the U.S.
More MICRO for Less Money
When You Subscribe
But on the newsstand — if you can locate the
issue you want — you pay $30.00 a year ($2.50
a copy).
Save 40% and make sure you get every issue.
Subscribe to MICRO today.
MICRO
34 Chelmsford Street
P.O. Box 6502
Chelmsford, MA 01824
Please send me MICRO for 1 year _ 2 years
NOTE: Airmail subscriptions accepted for 1 year only.
Check enclosed $_
Charge my
No,
VISA account
Mastercard account
Expiration date
Name
Address
City/state .
Subscription Rales
1 Year'
Country Air Surface
UnitedStates $18.00
Canada 21.00
Europe $36.00 21.00
Mexico, Central America 39,00 21 .00
Middle East, N. Africa 42.00 2100
S.America, Central Africa 51.00 21.00
S, Africa, Far East,
Australasia 60.00 21.00
* Airmail subscriptions accepted for only 1 year.
For U.S. and Canadian 2-year rates, multiply by 2.
-Zip
Job Title:
Type of Business/Industry:
112
MICRO -- Tlie 6502/6809 Journal
No, 40 -September 1981
Mountain Computer
CPS MultiFtmctlon Card
TM
The Only Interface Card You Need!
Connecting a Parallel Printer?
Epson - (Vntronifs - IDS Paper Tiger - C;PS handles all ihese
printers and others wiih on-board inielligente lo proWde
paging and ulhcr fti^iluccs found on no other card.
Connecting a Serial Printer?
Diablo*? Qume'^NEC: - TI 800 Series'? CPS handles these primers
and oihers Kith standard RS-232 inierface providing st'tettion
of baud rales, handshakes, paging, and more.
Connecting a Modem or Terminal?
Hayes Sm a nmodcin? Novation C:AT'?M k R Penny whist le?C:PS
handles these and others with full'half duplex operation, baud
rale selection, and even a transparent terminal mode which
includes a dual mode feature that permits printing of text lo
(larallel printers while 'on-line' eliminating the need for special
terminal software — and more.
Connecting with the Time?
The on-board calendar rlock provides real time and dale
information including day of week, day, month, year, hours.
minutes, and seconds (or any application requiring a time
stamp — battery backed-up for over two years!
Connecting with The Source?
Used with a modem, CPS provides the connection lo informa-
tion utilities, such as The Source, Dow Jones, and oihers.
Additionally, CPS provides the connetlion to big-lime electronic
mail wiih programs such as Micro Courter^nd Micro Telegran^
and other data transfer programs.
Connect ivith Easy Use!
CPS has no switches lo set! Ail functions on the card are sel
from a user jirogram, .Menu driven screens set up your choice
of all functions on CPS and store ihem on-fouard in CMOS
RAM — battcrv backed-up (including the clock) for over iwo
years! To change purameteis, run the set-up program again — or
use special commands from vour keyboard. Furlhermore. most
existing software programs are immediately usable with CPS,
Phantom Shi Capabitily permits assignment of CPS' functions
to your software's pre-defined slow.
Connect with Your Apple^Dealer
Drop by your Apple dealer and see how the CPS Multifunction
Card provides (he most comprehensive capabilities (or RS'232C
serial interface, parallel output, and real-time calendar/clock
of any card available today — all on one card — alone low price —
competitive with any one of (he three or mote single funcnon
cards thai ii replaces.
^
Mountain Computer
300 El Pueblo Road, Scotts Valley, CA-95066
(408) 438-6650 TWX: 910598-4504
>
3
Registered trademarks
Designing
Computer Software Programs
is Serious Business
ADVAN«DO^W-r>c.:."
ft Division
OPERATJNGS-'^^^^^
„«,So<».eOe.i.ne. „, ,„„.3. a,e a part oU.. .-*
=* 'ndusny ^^.^ g „g area ^^^^^^^ co W"M' ° ,„„eaang
;ea.e-.n«,««d,n.a«onhe ^ ,,, we a. .a* » .o »
work for you'.
Sincerely,
^X^reAct-^tion Manager
450 St. )oht> Road
suite 792 g3go
Michigan Oty. ''^
^219-879-1693)